Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

DNS Negative Caching

Direct 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.

When to use this

Use it when a record that was just created still "does not exist" for some users while it works for others.

First 30 seconds

1. dig <name> A @<authoritative server> +norecurse — record present?

2. Not → it is missing; not a cache issue.

3. Present, but dig <name> A says NXDOMAIN → cached negative answer; read the SOA's remaining time.

4. Flush the resolver if you control it, and the client's own cache.

5. For the future: create records before anyone queries them, or lower the SOA minimum.

Operational verification

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

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commanddig new.example.com A
Scope / prerequisiteUse it when a record that was just created still "does not exist" for some users while it works for others.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational verification Verify boundary
dig new.example.com A
dig new.example.com A @ns1.example.com +norecurse
dig example.com SOA +multiline
dig new.example.com A @192.0.2.53

The first query, through the usual resolver, shows what clients get. In a negative reply the authority section contains the SOA record, and the TTL printed on it is the time that reply will remain cached — it counts down on repeated queries. The second query, to the zone's own server, shows whether the record really exists. The SOA query shows the minimum field. Asking other resolvers shows which of them hold the negative answer.

Known-good: the zone's server returns the record; a resolver either returns it too, or returns a negative answer whose remaining time is short.

Step 2 Failure isolation workflow Narrow the fault
  • The zone's server has the record, the resolver says NXDOMAIN. A cached negative answer; the SOA's TTL in the reply tells how long remains.
  • Some users can resolve the name and others cannot. They use different resolvers, only some of which asked before the record existed.
  • The address works, IPv6 does not (or the reverse). A NODATA for one record type is cached, or that type was never added.
  • The resolver was flushed and the client still fails. The client's own cache holds the negative answer.
  • The zone's own server also says NXDOMAIN. Not a caching problem: the record is missing, in the wrong zone, or the change has not reached that server.
  • Recovery takes a full day. The zone's SOA minimum is 86400; lower it for the future.
  • A name alternates between found and not found. The zone's servers disagree with each other — some have the change, some do not.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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.

Key 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.
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

Resolvers cache not only answers but also failures. When a server replies that a name does not exist, or that it has no record of the requested type, the resolver remembers that for a while and gives the same reply to later queries without asking again.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

This is the reason a record that has just been created "still does not exist" for some users and not for others. Anyone whose resolver looked the name up shortly before it was created holds the negative answer until it expires. It is routinely mistaken for slow propagation; in fact the zone's servers have the new record from the first moment.

ReferenceHow it works1 section · depth on demand

How it works

Two kinds of negative answer.

AnswerHeaderMeaning
NXDOMAINStatus NXDOMAINNo record of any type exists under this name
NODATAStatus NOERROR, zero answersThe name exists, but not with the requested record type

Both are cached.

For how long. A negative reply carries the zone's SOA record in its authority section. The resolver may cache the reply for the lower of two values: the TTL of that SOA record, and the SOA's last field, the minimum. Many zones set this to an hour, some to a day. Resolvers also apply a ceiling of their own, commonly between one and three hours.

What that means in practice.

  • A name that nobody has asked about is not in any negative cache. Created quietly, it works everywhere at once.
  • A name that was tested before it existed — by the administrator checking, by a client retrying, by a monitoring system — is cached as non-existent in every resolver that was asked. Those resolvers keep saying so until the time runs out.
  • The same applies per record type: asking for the AAAA of a name before adding it caches a NODATA for AAAA only.
  • The zone's own servers always give the current answer; only resolvers remember.

Shortening it. The cached entry can be removed only on the resolver that holds it — by flushing that name or the whole cache, where one controls the resolver. Clients often keep a cache of their own on top. Lowering the SOA minimum affects future negative answers, not those already cached.

A low minimum, a few minutes, makes mistakes and late additions recover quickly at the cost of more queries for names that really do not exist.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Negative caching

Resolvers cache the fact that something doesn't exist, as well as answers. RFC 2308 defines two kinds of negative answer:

  • NXDOMAIN: the name doesn't exist.
  • NODATA: the name exists but has no records of the requested type, signalled by NOERROR with an empty answer section.

Both must carry the zone's SOA in the authority section, so they can be cached. The negative TTL is the lower of the SOA's MINIMUM field and the SOA record's own TTL. The RFC suggests one to three hours as a sensible limit and says values over a day cause problems.

NXDOMAIN versus NODATA

NXDOMAINNODATA
RCODE30 (NOERROR)
Answer sectionEmptyEmpty
Authority sectionSOA of the zoneSOA of the zone
MeansNo records of any type at this nameOther types exist; not this one
Exampletypo.example.netAAAA for a name with only an A record

Why negative caching surprises people

SituationEffect
A record created right after someone queried itResolvers keep returning NXDOMAIN until the negative TTL expires
Large SOA MINIMUM (for example 86400)A new record can take a full day to appear
IPv6 rolloutCached NODATA for AAAA hides new IPv6 records
host$ dig newhost.example.net A +noall +comments +authority | grep -E "status|SOA"
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12801
example.net. 3600 IN SOA ns1.example.net. hostmaster.example.net. 2026112801 7200 900 1209600 3600
host$ dig www.example.net AAAA +noall +comments +answer | grep -E "status|ANSWER"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33012
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
host$ sudo unbound-control flush newhost.example.net
host$ sudo rndc flushname newhost.example.net

Before adding names

Before creating names that clients may already have queried, for example during migrations, lower the SOA MINIMUM a few hours in advance. Alternatively, plan to flush the negative entries on the resolvers you control.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 1034

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → DNS Negative Caching. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc1034.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
negative dns cachenxdomain cachedns nodata
Confirmation

Confirm action

Continue?