Pcornel
Networking · Network & Protocols › DNS Protocol Reference

DNS Negative Caching

Cheat sheet · https://pcornel.dk/topic.php?topic=305

Back to the Topic

Answer

Resolvers cache failures as well as answers. A reply saying a name does not exist, or has no record of the requested type, is remembered and repeated for a while without asking again.

Remember

Anyone whose resolver looked the name up before it was created holds the negative answer until it expires — at most the zone's SOA minimum, often an hour. The zone's own servers have the record at once. It can only be cleared on the resolver that holds it.

First checks

  • dig <name> A — through the usual resolver; in a negative reply the SOA's time to live is the time left.
  • dig <name> A @<authoritative server> +norecurse — does the record really exist?
  • dig <domain> SOA +multiline — the minimum field.
  • dig <name> A @<other resolver> — which resolvers hold the negative answer.

Verify in this order

name queried before it exists → negative answer with the SOA → cached for min(SOA time to live, SOA minimum) → record created → cache entry expires → resolver fetches the new record

Where it usually breaks

local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=305

Confirmation

Confirm action

Continue?