DNS negative caching

DNS Negative Caching Explained: Why New Records Can Still Appear Missing

You add a new DNS record, confirm it appears on your authoritative nameservers, and still some visitors cannot reach the service. The cause may be DNS negative caching: a recursive resolver remembers an earlier answer saying the name or requested record did not exist.

Ordinary DNS caching stores successful answers. Negative caching stores certain unsuccessful answers, reducing repeated queries for missing names. Both improve efficiency, but a cached negative answer can briefly hide a record that has just been created.

Understand NXDOMAIN and NODATA

NXDOMAIN means the queried domain name does not exist. NODATA means the name exists, but it has no record of the requested type. For example, a name may have an A record but no AAAA record. These are different from SERVFAIL, which reports that a resolver could not complete a lookup; our SERVFAIL troubleshooting guide covers that separate problem.

If a resolver receives a cacheable NXDOMAIN or NODATA response before you publish the missing record, it can continue returning that old negative result until its cache timer expires.

Find the Negative Cache Lifetime

An authoritative negative response includes the zone’s SOA record. The negative caching TTL is determined by the lower of the SOA record’s own TTL and its MINIMUM field. This is not necessarily the TTL you assign to the new A, AAAA, or TXT record. Lowering only that new record’s TTL after the failed lookup will not immediately clear an existing negative cache entry.

Our SOA record guide explains the other fields in that record. The ClouDNS TTL reference also describes how negative answers use the SOA values to control cache duration.

Compare Resolver and Authoritative Results

Use dig new.example.com A @your-authoritative-server to check whether the record is now present at the source. Repeat the query against every authoritative nameserver. If one still returns a negative answer, investigate zone synchronization or a stale secondary server before blaming caches.

Then query the same name and type through several recursive resolvers. An authoritative answer showing the new record alongside a recursive NXDOMAIN or NODATA response is consistent with cached negative data. Look at the SOA in the negative response and its remaining TTL. Avoid relying on a single local machine: browser, operating-system, and network caches can add another layer of confusion.

Plan Changes and Recover Safely

Before launching a new hostname, publish its required DNS records ahead of public use when possible. Avoid repeatedly testing a nonexistent name through the same resolver before it is created, as that can seed a negative cache. For planned migrations, check the relevant SOA negative TTL as well as the positive record TTL discussed in our DNS TTL guide.

After fixing a missing record, verify authoritative consistency and allow cached negative answers to expire. Flushing one device’s cache may help that device, but it cannot force every resolver on the internet to discard an entry. Keep the original query name, record type, resolver address, and timestamp in your incident notes for comparison. For the precise rules covering NXDOMAIN, NODATA, and SOA-based negative TTLs, see RFC 2308: Negative Caching of DNS Queries.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *