How DNS works behind the scenes · Lesson 6 of 9 · 3 min read
Inside a recursive resolver
What a good resolver does
- Caches positive and negative answers by TTL; may enforce minimum/maximum TTLs.
- Chooses among name servers for a zone by tracking their response times (SRTT) — it prefers the fastest and retries others on timeout. A slow or dead name server in your NS set adds latency for some users.
- Retries and handles truncation (switching to TCP).
- QNAME minimisation — sends each server only the part of the name it needs (privacy).
- Prefetching — refreshes popular records just before expiry.
- Serve-stale — keeps answering with expired data if authoritative servers are unreachable.
- DNSSEC validation — verifies signatures up the chain to the root's trust anchor; returns SERVFAIL for bogus data and sets AD for validated answers.
- Rate limiting and security — randomised source ports and query IDs, response rate limiting.
- EDNS Client Subnet (ECS) — optionally forwards a truncated client subnet so geo/latency-based authoritative answers (CDNs, Route 53 latency/geolocation routing) fit the actual user rather than the resolver's location.
When the resolver is the problem
- "The site is down for some users but works for me" — their resolver may have a stale or poisoned cache, or receives different geo/latency answers. Compare:
dig @<their resolver> namevs yours. - ISP resolver outage — every lookup fails while sites are actually up; switching resolvers fixes it. This is why DNS is often called a single point of failure: misconfiguration or a provider outage breaks everything that depends on names.
- Timeouts vs NXDOMAIN — a timeout means no reply (network or resolver issue); NXDOMAIN is a definite "doesn't exist" (wrong name, missing record, negative cache).