Use it when a resolver is slow or fails, to follow the lookup from root to the authoritative server.
Recursive lookup
In a recursive lookup the resolver does the work for the client: it queries root, TLD and authoritative servers in turn (or uses its cache) and returns the final answer.
1. Recursive lookup: resolver queries root, TLD, then authoritative servers.
2. Clients ask resolvers recursively.
3. Caching speeds repeated lookups.
4. Failures at any delegation step break resolution.
5. +trace shows each step.
client → resolver → root → TLD → authoritative → answer
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & 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 Verification & troubleshooting Narrow the fault
1. Record queried name/type and resolver.
2. Test reachability and UDP/TCP 53.
3. Query the recursive resolver.
4. Trace delegation/authority when needed.
Step 2 Recursion problems Narrow the fault
- Resolver cannot reach root/TLD servers (outbound UDP/TCP 53 blocked) — configure forwarders or open the firewall.
- EDNS fragmentation issues → set
edns-udp-size 1232. - DNSSEC validation failures return SERVFAIL (
dig +cdworks). - Open recursion to the internet (amplification abuse) — restrict with ACLs.
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.
- A/AAAA map names to IPv4/IPv6; CNAME aliases one name; PTR is reverse lookup
- Recursive and authoritative roles answer different questions
- UDP 53 is common, while TCP 53 is required for some large replies and zone operations
- NXDOMAIN, NODATA, SERVFAIL and timeout indicate different boundaries; TTL controls cache lifetime.
dig <name> +trace— iterative path from rootdig @<resolver> <name>— recursive answer
ReferenceWhat it is1 section · depth on demand
Walk-through
1. Client asks its recursive resolver for www.example.com (RD flag set).
2. Resolver asks a root server → referral to .com servers.
3. Asks a .com server → referral to example.com name servers.
4. Asks the authoritative server → answer.
5. Caches the answer for its TTL and replies to the client (RA flag set).
dig +trace www.example.com shows each step.
ReferenceWhy it matters1 section · depth on demand
How it works
A client sends one recursive query to its resolver. If the answer is not cached, the resolver walks the tree itself: root servers → TLD servers (e.g. .com) → the domain's authoritative servers, following referrals until it gets the answer. It caches each step for its TTL and returns the final answer to the client.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
See the iterative walk the resolver performs
$ dig +trace www.example.com
. 518400 IN NS a.root-servers.net.
com. 172800 IN NS a.gtld-servers.net. ;; from a.root-servers.net
example.com. 172800 IN NS a.iana-servers.net. ;; from a.gtld-servers.net
www.example.com. 300 IN A 192.0.2.80 ;; from a.iana-servers.net
+trace makes dig do the iteration itself; a normal dig @resolver sends one recursive query and shows only the final answer.
Flags and status codes that tell you where it failed
| Output | Meaning |
|---|---|
flags: qr rd ra | Recursion desired and available — resolver did the work |
no ra flag | Server is not recursive for you (authoritative-only or ACL) |
status: NOERROR, empty answer | Name exists, no record of that type (NODATA) |
status: NXDOMAIN | Name does not exist (negatively cached for the zone's SOA minimum, RFC 2308) |
status: SERVFAIL | Resolver could not get a valid answer — unreachable authoritative servers or DNSSEC validation failure |
status: REFUSED | Resolver does not serve this client |
Isolating the layer
1. dig @resolver name — what clients see.
2. dig @resolver name +cd — same with DNSSEC checking disabled; if this works and step 1 SERVFAILs, the zone's signatures are broken.
3. dig @authoritative name +norecurse — what the source of truth says.
4. Compare TTLs: an old answer still cached explains "fixed but still broken".
Cisco IOS as a client
ip name-server 192.0.2.53 192.0.2.54
ip domain lookup source-interface Loopback0
Resolvers must allow recursion only for internal clients; open recursive resolvers are used for amplification attacks.
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 IP Services → DNS → Recursive lookup. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc1034.html · confidence 94%