Internet Internals
DNS Remembers Things That Do Not Exist
A newly created DNS record can remain invisible because resolvers cached an earlier negative answer. Understanding negative caching helps explain the delay.
- DNS
- NXDOMAIN
- RFC
- Networking
- Internet Infrastructure
Quick summary
A newly created DNS record can remain invisible because resolvers cached an earlier negative answer. Understanding negative caching helps explain the delay.
You add a DNS record, query it immediately, and still get an answer saying it is absent. The authoritative zone may already be correct. A recursive resolver may be remembering a previous response that said the name or requested record did not exist. DNS caches store negative answers as well as successful records, so the history of a name can matter after a change.
NXDOMAIN is not NODATA
NXDOMAIN means the queried domain name does not exist. A response with no requested record set but an existing name is a different negative result, often called NODATA: for example, the name exists but has no AAAA record. The distinction matters operationally. A cached NXDOMAIN can affect lookups beneath that name under applicable rules; NODATA is about the requested type at an existing name. DNS response codes and authority-section SOA data provide useful clues, but query context matters.
How long can a negative answer live?
RFC 2308 specifies how negative responses are cached. For authoritative negative answers, the negative-cache TTL is derived from the SOA record included with the response: the lesser of the SOA RR’s TTL and the SOA.MINIMUM field. That value is subject to resolver policy and limits; do not assume every resolver will retain it for exactly that duration. It is the SOA in the negative response—not the TTL you later set on a newly created A record—that informs the earlier negative cache entry.
This explains a common surprise: reducing the new record’s TTL does not erase a resolver’s previously cached NXDOMAIN. The resolver has no reason to query the new record until its negative entry expires or is otherwise cleared. Different recursive resolvers, operating-system caches, browsers and local forwarding services may each have their own cached state. Publishing a change and observing different answers from different networks is therefore possible without the authoritative data being inconsistent.
NXDOMAIN cut and failure caching
RFC 8020 formalizes the “NXDOMAIN cut”: a resolver may use a cached NXDOMAIN for a name to answer queries for names below it, rather than separately resolving each descendant. This can magnify the effect of a negative answer—for instance, an erroneous NXDOMAIN at a zone boundary can affect queries beneath the name for the lifetime of that cached information. It does not mean every negative response covers the entire DNS tree.
Do not confuse these DNS data negatives with failure caching. RFC 9520 addresses caching DNS resolution failures, including cases where resolution cannot complete due to errors or timeouts. A timeout is not proof that a name does not exist; it is a different failure category with its own caching guidance. Troubleshooting should distinguish NXDOMAIN, NODATA, SERVFAIL and timeouts rather than treating all “no answer” observations as interchangeable.
Trace the answer from authority to client
Use dig to compare a recursive resolver with an authoritative server. For example:
dig new.example.net A
dig @1.1.1.1 new.example.net A
dig @ns1.example.net new.example.net A
dig new.example.net A +noall +answer +authority
dig +trace new.example.net A
Replace the example name and nameserver with values from an authorized test zone. Inspect the status line, answer section, authority SOA and TTLs. +trace walks delegation from the root; it is not identical to asking a recursive resolver and may not expose that resolver’s cache. Query the authoritative server directly after identifying it, and compare results from the client’s configured recursive resolver and another independent resolver. A local stub or VPN-provided forwarder can be another cache layer.
Before changing a zone, lower relevant TTLs in advance when an orderly migration is planned; that does not retroactively shorten an already cached negative TTL. Verify delegation, authoritative zone contents and response type, then allow negative entries to age out or clear caches you control. Avoid indiscriminate resolver cache flushing as a substitute for discovering which layer has the stale data.
HTTP caches face a related identity question under different protocol rules; their cache keys can become security boundaries. DNS negative caching instead distinguishes names, record types and resolution outcomes.
The primary references are RFC 2308 for negative caching, RFC 8020 for NXDOMAIN cuts, and RFC 9520 for resolution-failure caching. A DNS answer is not only a statement about the present; it may also be a cached statement about what a resolver was told earlier.
Prevention is easier than cache archaeology
Negative caching matters during first-time deployment and migrations. A client can ask for a name before its record is published, seeding a resolver’s negative cache. For planned migrations, publish and validate records before clients depend on them, and lower relevant TTLs in advance while old data is still live. Changing SOA values later affects future negative responses, not copies already cached elsewhere.
Interpret TTLs as remaining lifetime, not a universal countdown shared by observers. A recursive answer’s TTL may be lower because it has aged; resolver caps and local caches also affect what users see. A direct authoritative query bypasses recursive cache and can look healthy while clients receive stale data. Record resolver address, queried name and type, response code, authority data and time. This distinguishes stale cache from delegation or local-stub issues.
RFC 8020’s NXDOMAIN cut follows DNS name hierarchy: a cached negative for a name can affect descendants, but not an unrelated sibling name. Verify the exact denied name and zone boundary. SERVFAIL and timeouts indicate resolution failures, not proof that a name does not exist.
References
RFC 2308: Negative Caching of DNS Queries
RFC 8020: NXDOMAIN: There Really Is Nothing Underneath
RFC 9520: Negative Caching of DNS Resolution Failures