Use it when "DNS does not work" has to be narrowed down: the client's resolver setting, the resolver's reach, the domain's delegation, or just an old cached answer.
DNS Recursive Resolution Journey
A device asks one recursive resolver and waits. The resolver does the work: it asks a root server, then the top-level domain's servers, then the domain's own servers, following a referral at each step, and caches what it learns.
1. dig <name> @<authoritative server> +norecurse — is the zone's own answer right?
2. dig <name> — does the resolver agree?
3. Disagree → cached answer (wait or flush), or the resolver cannot reach the zone.
4. dig <name> +trace — where does the walk stop?
5. dig right, application wrong → the client's own cache or hosts file.
client asks its resolver → cache hit, or: root refers to the top-level domain → that refers to the domain's servers → authoritative answer → cached → returned to the client
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
dig www.example.comVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
dig www.example.com
dig www.example.com @192.0.2.53
dig www.example.com +trace
dig www.example.com @ns1.example.com +norecurse
The plain query uses the resolver the system is configured with; the last line of the output names the server that answered. Naming a resolver with @ tests a specific one. +trace makes dig do the resolver's job itself, starting at the root and printing each referral — it shows where a delegation breaks. Asking the domain's own server directly shows the content of the zone without any cache in between.
On a client, also check which resolver it actually uses: ipconfig /all on Windows, resolvectl status on Linux.
Known-good: the zone's own server gives the expected answer, +trace reaches it without detours, and the client's resolver returns the same.
Step 2 Failure isolation workflow Narrow the fault
- The zone's server answers correctly, the resolver does not. The resolver has an old answer cached — wait for the TTL or flush its cache — or it cannot reach the zone's servers.
+tracestops at a referral. The servers named there do not answer or do not hold the zone: a broken delegation.- One resolver works, another does not. Different caches, different forwarders, or split DNS giving each a different view.
- The client gives a different result from
digon the same machine. The operating system's own cache or hosts file; flush it (ipconfig /flushdns,resolvectl flush-caches). - Internal names fail on a device. It uses a public resolver, which does not know the internal zone.
- All external names fail, internal ones work. The resolver cannot reach the Internet or its forwarder on port 53.
- Lookups are slow the first time and fast afterwards. Normal: the first one walks the whole path, later ones come from cache.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Each party has its own cache. Compare three answers: what the client gets, what its resolver says, and what the domain's own server says. dig +trace walks the path from the root and shows where a delegation breaks.
dig <name>— through the system's resolver; the last line names the server that answered.dig <name> @<resolver>— a specific resolver.dig <name> +trace— each referral from the root down.dig <name> @<authoritative server> +norecurse— the zone itself.ipconfig /all/resolvectl status— the client's resolver.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
When a device looks up a name, it asks one server — its recursive resolver — and waits. The resolver does the real work: it asks a root server, then the servers for the top-level domain, then the servers of the domain itself, following a referral at each step, and finally returns the answer and keeps it in its cache.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
A lookup involves several parties, each with its own cache and its own possible failure. "DNS does not work" can mean the client asks the wrong resolver, the resolver cannot reach the outside, the domain's delegation is broken, or everything works and an old answer is simply still cached. Knowing the path makes it possible to test each stage separately.
ReferenceHow it works1 section · depth on demand
How it works
The parties.
| Party | Role |
|---|---|
| Stub resolver | The part of the operating system that sends the query to the configured DNS server. Often has a small cache of its own |
| Recursive resolver | Resolves names on behalf of clients and caches the results. Run by the organisation, the ISP or a public service |
| Root servers | Know which servers are responsible for each top-level domain |
| Top-level domain servers | Know which servers are responsible for each domain under .com, .dk and so on |
| Authoritative servers | Hold the actual records of a domain |
Resolving www.example.com with an empty cache.
1. The client asks its resolver for www.example.com, with the "recursion desired" flag.
2. The resolver asks a root server. The root answers with a referral: "ask the .com servers", with their names and addresses.
3. The resolver asks a .com server. It answers with another referral: "ask the servers of example.com".
4. The resolver asks one of those. It answers with the address record, marked authoritative.
5. The resolver returns the answer to the client and caches everything it learned along the way.
The client made one query. The resolver made three — each of them a plain, non-recursive query to a server that either answers from its own data or refers onwards.
Caching changes the picture for every later lookup. For as long as the records' TTLs last, the resolver answers from memory; it skips the root and .com entirely for other names in the same domain. An answer from a resolver is therefore not necessarily the current content of the zone.
Variations. A resolver may be configured to pass all queries to another resolver — a forwarder — instead of working from the root. Internal names are often served by the organisation's own servers and never reach the Internet. A domain can have different content inside and outside the organisation (split DNS), so the same name gives different answers depending on which resolver is asked.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
The journey of a recursive lookup
Most clients ask a single server and let it do the work. RFC 1034 calls these clients stub resolvers. A stub relies on a recursive server, requested with the RD bit and offered with the RA bit. The recursive server queries iteratively. It starts at the root, follows referrals (NS records at each zone cut) down the tree, and reaches the authoritative servers for the name. Every answer and referral is cached for its TTL, so later lookups skip most of the steps.
Steps for www.example.net with an empty cache
| Step | The resolver asks | Answer |
|---|---|---|
| 1 | A root server | Referral to the .net servers (NS + glue) |
| 2 | A .net server | Referral to ns1/ns2.example.net (NS + glue) |
| 3 | ns1.example.net | Authoritative answer: A 192.0.2.40 (AA set) |
| 4 | The resolver replies to the client | The answer with RD and RA set |
With a warm cache, steps 1 and 2 are usually skipped. The .net referral is cached for its TTL, which is typically a day or more.
Where time goes
| Delay | Cause |
|---|---|
| Hundreds of ms on the first lookup | A full walk from the root, or slow authoritative servers |
| Consistently slow, even for popular names | The resolver is overloaded or far away |
| Timeouts, then success | An authoritative server isn't responding; the resolver tries the next |
| Very fast | Cache hit: the answer TTL is lower than the configured TTL |
host$ dig +trace www.example.net A | grep -E "^\.|^net\.|^example\.net\.|^www" | head -8
host$ dig @10.20.0.53 www.example.net A | grep -E "Query time|SERVER"
;; Query time: 41 msec
;; SERVER: 10.20.0.53#53(10.20.0.53) (UDP)
host$ dig @10.20.0.53 www.example.net A | grep "Query time"
;; Query time: 1 msec
host$ resolvectl query www.example.net
host$ unbound-control lookup example.net
The second query takes 1 ms because the answer is now in the cache.
Iterative queries in practice
RFC 1034 notes that iterative resolution suits datagram access. dig +trace repeats the walk itself, without using your resolver's cache. That makes it the best way to see what the authoritative servers actually say.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → DNS Recursive Resolution Journey. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc1034.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
DNS Resolution Fast Check
Client resolver → delegation → authoritative answer.
1. Query the exact resolver in use.
2. Record RCODE/answer/TTL.
3. Check cache context.
4. Trace parent delegation.
5. Query each authoritative server directly.