Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article3 min readViews0

Why dig and the app see different addresses: checking resolvectl

How to view DNS servers and name resolution rules in a systemd-resolved system, especially with VPNs and multiple network interfaces.

Laptop network adapter and two connection cables
In this article

The DNS utility returns the expected address, but the app continues connecting to another. The cause may be that they use different name resolution paths. On systems with systemd-resolved, DNS selection depends not only on a single global file but also on interfaces and domain rules.

Ensure this mechanism is in use

This guide applies to Linux systems where systemd-resolved is installed and running. If the system uses a different resolver, the commands may be unavailable or may not describe the actual path used by the app. Do not enable the new service solely to follow this instruction.

resolvectl status

View general settings and details for each interface: DNS servers, domains, and connection role. With an active VPN, these differences often explain why an internal name must resolve via the corporate network.

Check the name via the system service

Enter the domain name without protocol and path:

read -r TARGET_HOST

resolvectl query "$TARGET_HOST"

The query shows the result obtained via systemd-resolved and related details. Compare it with what the application uses. A direct query dig to a specific external server checks a different path and therefore does not have to return the same result.

Consider DNS separation by domain

In an organization, some names may be served by internal DNS, while others use a standard internet connection. After connecting to a VPN, not necessarily all DNS changes, but only the routing of requests for specific domains. Therefore, universally replacing all servers with public ones can break working services.

Example: a public site opens, but the internal portal stops resolving after reconnection to the VPN. First, compare the settings of the relevant interface and domain rules. If the corporate DNS disappears from the connection state, the issue cannot be resolved by editing a public domain record.

Do not rely solely on the system resolver

A browser may use its own secure DNS, while an application might use an internal cache or a library with special behavior. A container can also receive a separate configuration. A successful resolvectl query confirms a specific resolution path, but not all possible paths on the machine.

Also check the exact name: a short name with a search suffix and a fully qualified domain name can trigger different queries. Do not modify the configuration until it is confirmed which name the problematic application is actually requesting.

How to gather evidence

Record the VPN state, interface, DNS server, domain rule, and query result. If a before-and-after comparison is needed after reconnection, perform it in a clear order and note the time. Do not clear the cache as the first step: this may temporarily alter the symptom without explaining the cause.

A fix is considered verified only when the correct response is received by the specific application in the expected network. Distinguish between a system query, a direct DNS query, and browser behavior: these differences help identify the error level. A single successful utility response does not replace this verification.

If the error occurs only after waking from sleep or changing networks, note this in the report: the timing of the connection configuration update is critical.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.