DNS Dig Guide: Read Answers and Trace Delegation
A dig query can show what a DNS server returns for a name and record type. Comparing that answer with an authoritative server helps locate a discrepancy; tracing DNS delegation with dig adds a view of the public chain of referrals. These are distinct tests, and neither automatically reproduces an application’s local cache behavior.
Ask a specific server
For DNS, dig sends a query to a server and displays the response. The following illustrative command asks a designated resolver for an IPv4 address record:
dig @192.0.2.53 portal.example.com A
Here @192.0.2.53 represents a documentation-only server address, portal.example.com is the name, and A is the record type. Replace the server and name with values approved for the environment. For a DNS lookup with dig, omitting the server normally uses a configured resolver. AAAA asks for IPv6 address records. A terminal needs a compatible dig DNS utility installation; availability differs by platform.
Record the server queried, the full name, type, time, and network or VPN. Internal and public DNS views can deliberately differ, so compare the response against the correct source for the client’s environment. A successful answer from a public resolver does not establish that an internal name should resolve there.
Read status, answer, and authority
The header’s status indicates the result of processing the query. NOERROR can accompany an answer, but it can also appear when the name exists and has no record of the requested type. NXDOMAIN indicates that the responding server says the queried name does not exist. SERVFAIL indicates that the server could not complete the request; its cause requires further investigation. A timeout means no response arrived within the test period, which can involve reachability or filtering as well as server availability.
The ANSWER section contains records returned for the question, including any alias chain and its target records when supplied. Read the owner, type, value, and time to live (TTL). A recursive resolver may return a cached answer with a remaining TTL; the value is not necessarily the original TTL configured at the authority.
The AUTHORITY section, when present, can contain referral information or a zone’s SOA record in a negative response. Its absence in a particular response is not itself an error. The aa flag indicates that the responding server asserts authority for the answer; check the server and context rather than assuming every response is authoritative. ISC’s explanation of authoritative and recursive servers describes their different roles (accessed November 19, 2026).
Check mail routing
With dig, MX records can be requested explicitly:
dig example.com MX
An MX answer lists mail exchanger hostnames and preference values; a lower number has higher preference. The result describes DNS mail routing for that domain, not proof that the mail server accepts messages. Resolve the returned hostnames separately and involve the mail administrator if the configured targets differ from expectations.
Dig trace and the delegation path
Use dig to trace the public delegation chain:
dig example.com A +trace
The command follows referrals from the root toward the authoritative servers. It can reveal where delegation stops or an expected nameserver is missing. A trace depends on the client’s ability to contact the relevant servers; a blocked query or timeout may reflect the test path rather than a broken delegation. Private zones may not have a public delegation to trace.
The dig trace result is not necessarily the answer a recursive resolver gives its users. That resolver may use cached data, forwarding, or a private view. Nor does dig normally inspect the application’s local DNS cache. ISC’s trace guidance explains why the paths can differ (accessed November 19, 2026).
When answers disagree, repeat the same name and type against the approved recursive and authoritative servers, recording response, TTL, server, and time. Give those results and the relevant network context to the DNS owner, who can investigate the zone, delegation, cache, or view responsible.