Negative DNS Caching – Typical Duration and Details

domain-name-system

If a DNS server looks up a record and it's missing, it will often "negatively cache" the fact that this record is missing, and not try to look it up again for a while. I don't see anything in the RFC about the TTL on negative caching should be, so I'm guessing it's somewhat arbitrary. In the real world, how long do these negative records stick around for?

Best Answer

The TTL for negative caching is not arbitrary. It is taken from the SOA record at the top of the zone to which the requested record would have belonged, had it existed. For example:

example.org.    IN      SOA     master-ns1.example.org. Hostmaster.example.org. (
            2012091201 43200 1800 1209600 86400 )

The last value in the SOA record ("86400") is the amount of time clients are asked to cache negative results under example.org..

If a client requests doesnotexist.example.org., it will cache the result for 86400 seconds.