A DNS Lookup, End to End: Delegation, Caches, and Negative Answers
Follow a DNS cache miss through recursive resolution, zone delegation, TTLs, and negative caching—without assuming every request takes the same path.
On this page

“DNS is always the first step” is a useful debugging instinct and a poor literal description. A browser may use a cached answer; an application may reuse a socket; a local stub resolver may forward to a recursive service. DNS matters when a name must be resolved, but the lookup path depends on what each layer already knows. RFC 1034 describes the hierarchical namespace and caching design; RFC 1035 specifies message formats and resolver/server behavior. [1] [2]
Names are divided into zones
The DNS name space is a tree. Administrative responsibility is divided into zones, and delegation records direct a resolver toward the name servers responsible for a subdomain. A domain owner’s authoritative servers hold records for the zones they serve; they do not each hold a complete copy of the entire Internet’s name data.
A simplified cold lookup for www.example.com may begin with a recursive resolver that knows root-server addresses but has no useful cached referral. It asks a root server, receives a referral toward .com, asks a .com server for example.com, and then asks an authoritative server for the requested record. In practice, the resolver may already have root or TLD referrals, and the delegation can involve aliases, DNSSEC, multiple addresses, retries, or transport changes. [1] [2]
The root servers do not normally answer with the final address of every website. They provide referrals. Likewise, a TLD server generally points toward the delegated domain’s authoritative servers rather than returning the site’s A or AAAA record. This distinction helps debug which authority is responsible for a missing or stale record.
Recursive and authoritative roles differ
A stub resolver on a laptop or phone usually asks a recursive resolver to do the work. The recursive service performs or reuses the sequence of queries and returns a final answer, often with a time-to-live. An authoritative server answers from the zone data for which it is responsible. A server can play multiple roles in some deployments, but the roles describe different work.
Resolvers cache records to reduce repeated lookups and load on authoritative infrastructure. A cached response is not a permanent copy: its TTL counts down, and the resolver discards or refreshes it according to protocol and local policy. Some resolvers can serve stale data under specified resilience policies; do not assume all implementations behave identically. [2]
Positive answers are only half the cache story
A positive answer says that a name has data of the requested type. A negative answer can say either that the name does not exist (NXDOMAIN) or that the name exists but has no record of the requested type (NODATA). RFC 2308 defines negative caching using the zone’s SOA information so that resolvers do not have to repeat the same unsuccessful query continuously. RFC 9520 later updates requirements for caching resolution failures, including server failures and unreachable servers. [3] [4]
Negative caching can surprise operators during rollout. If a client asks for a record before it exists, a resolver may cache the negative response. Adding the record immediately afterward does not necessarily make that resolver query again before its negative TTL expires. A domain that returns one type but not another can also produce a NODATA result that is different from “the domain does not exist.” Capture the DNS response code, answer section, authority section, and TTL rather than reporting only “DNS failed.”
TTLs are an operational contract
A TTL expresses how long a cached record may be reused under normal DNS cache rules. It is not a global push-notification timer. Lowering the record’s TTL shortly before a migration does not retroactively shorten a copy already cached with the previous TTL. Plan DNS changes with the prior TTL, client connection reuse, resolver behavior, and the application’s fallback path in mind.
Very short TTLs can increase query volume and do not force every client to observe an update at a precise second. Long TTLs reduce repeated lookups but can slow ordinary changes. The right choice depends on how frequently the record changes and whether the service can tolerate old answers during a transition.
Anycast is a routing property, not a DNS record type
A DNS provider can advertise the same service address from multiple network locations and use BGP routing to direct packets toward one of those locations. That is an anycast deployment pattern at the IP routing layer. It is not a special DNS record, and it does not guarantee the geographically nearest site or successful service. Routes, peering, congestion, health policy, and the provider’s network all affect which location receives a packet.
Keeping the layers separate improves incident diagnosis: DNS resolves a name into records; IP routing selects a network path to an address; transport establishes a connection; the application then serves the request. An anycast authoritative service can influence where a DNS packet is answered, but it does not make cached records disappear or repair a broken delegation.
Trace the failure at the right layer
When a name fails, compare the answer from the client’s configured resolver with a query to a known recursive resolver and, when needed, an authoritative server. Check the exact QNAME and QTYPE, response code, TTL, delegation chain, DNSSEC validation state, and whether the failure is cached. Then test the resulting IP path separately. Avoid flushing every cache as the first step; it can hide evidence and create an unnecessary query surge.
Do
- Record the resolver, query name/type, response code, answer, authority section, and TTL.
- Distinguish NXDOMAIN, NODATA, timeout, and server failure.
- Plan migrations around existing TTLs and established connections.
Don't
- Do not claim every HTTP connection performs a fresh DNS lookup.
- Do not treat the root or TLD servers as the final authority for an ordinary host address.
- Do not assume anycast always selects the geographically nearest healthy server.
DNS works because hierarchy and caches divide a global naming problem into manageable pieces. The operational skill is to identify which layer answered—and how old that answer may be.
Frequently asked questions
Does every HTTP connection begin with a DNS lookup?
No. Applications may reuse an existing connection, and answers may be present in browser, operating-system, or recursive-resolver caches. DNS is consulted when the relevant name and record are not already available under the client’s resolution behavior.
What does a recursive resolver do on a cache miss?
It obtains referrals through the DNS hierarchy and queries authoritative servers for the requested name and type. Exact behavior depends on its starting data, delegation, transport, and cached records.
What is the difference between NXDOMAIN and NODATA?
NXDOMAIN indicates that the queried name does not exist; NODATA indicates that the name exists but the requested record type is absent. RFC 2308 specifies how negative answers can be cached.
Why can a DNS change remain invisible after an update?
Resolvers can keep cached positive or negative answers until their TTL or applicable cache policy expires. Lowering a TTL shortly before a change does not necessarily change copies already cached with the earlier TTL.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.