Skip to content
WebsiteHosting.com

concept Domains & DNS

Recursive DNS resolver

Understand recursive DNS resolvers, cache hits and misses, negative caching, and why cached data is not a global clock.

Sources checked · P0015

What it means

A recursive resolver accepts a client DNS question and seeks an answer through cache and other DNS servers. Its output depends on the question, earlier cached data, delegation, availability and validation policy. A resolver response is evidence of what that resolver returned then—not proof of the current authoritative value everywhere. Resolution Terminology

Try it

Simulation — watch a resolver retain different questions. Query the fixed name/type, repeat it, or advance the virtual clock by 30 seconds. The cache inventory records each fill and expiry; the last answer is kept separate from the controls for your next question.

A resolver’s cache inventory

Query, repeat, advance time, and see which question the cache can answer.

Simulation
NONE: No query yet

The last answer is shown separately from current inputs. Query again to observe the selected name and type; advancing time alone does not perform a lookup.

A resolver’s cache inventory: current state
ItemState / resultWhy it matters
Virtual clock0 sTime only moves forward until Reset.
CacheEmptyThe first query needs an authoritative result.
A resolver’s cache inventory: local inputs and actions

One local resolver, fixed answers and no serve-stale, prefetch, eviction, failure-cache/backoff or DNSSEC validation.

About this model

A and AAAA occupy separate positive/NODATA cache entries. This fixture stores NXDOMAIN by name. Cached entries retain their original expiry when reused. The TTL control applies to subsequent fills only. Failed refresh is not NXDOMAIN. Real resolvers must also cache resolution failures under RFC 9520; this teaching scene omits that cache and retry/backoff behavior. Real negative lifetimes come from the applicable SOA data and policy; this scene uses one explicit chosen lifetime for clarity.

Read the article’s primary sources for protocol rules and implementation-specific limits. This scene has no network access.

Query www.example.test A at t=0, advance to t=30, and query again. The answer comes from cache and still expires at t=60: reading it did not restart the TTL. At t=60 a new query needs a fresh result. Mark the authority unavailable before that query to observe a resolution failure, not a newly invented NXDOMAIN.

Next reset, ask for AAAA at the existing name, and then ask for A. The AAAA NODATA entry does not erase or deny the A RRset. By contrast, missing.example.test produces an NXDOMAIN entry keyed by name in this fixture, so it can answer a subsequent question for a different type at that same absent name. Negative caching distinctions

ObservationCache effectLimit of the conclusion
Repeated valid hit before expiryOriginal expiry is retainedIt does not refresh authority
AAAA NODATA at an existing nameStored for that name/typeA may still exist
NXDOMAIN at the absent fixture nameStored as a name-level negative answerNot the same as a timeout
TTL zeroNo reusable entry is addedOther records in a real lookup may still be cached

The chosen lifetime applies to subsequent fills. For simplicity the same control also sets this fixture's negative lifetime; real negative lifetimes depend on SOA data and applicable policy. The scene excludes prefetch, eviction, serve-stale, validation and failure-cache/backoff behavior. RFC 9520 updates RFC 2308 to require caching of resolution failures; repeated failed queries here are individual teaching observations, not a resolver retry policy. Failure caching Reset empties the cache, clears history and restores t=0. Recursive operation Serve-stale is a separate behavior

What a cache can store

OutcomeWhat a recursive resolver might reuse
Positive answerA, AAAA or other RRset while its cached lifetime remains
Negative answerNXDOMAIN or absence of a queried type (NODATA), subject to negative caching rules
ReferralDelegation data used to find other nameservers
Expired but recoverable dataSome implementations may serve stale data under specified failure conditions

Negative caching matters when a new hostname is created after users previously received NXDOMAIN. The negative response can remain cached with a lifetime derived from the zone's SOA information; it is not simply the prospective new record's TTL. Negative caching

RFC 8767 describes serve-stale behavior, under which a resolver can retain and conditionally answer with expired information to maintain service when fresh DNS lookups encounter difficulties. Do not assume every resolver enables it or that a stale response proves the authoritative zone is outdated. Serve stale

Useful cache versus a misleading diagnosis

A resolver may return 192.0.2.10 from an earlier A record while the authoritative answer has changed to 192.0.2.20. That difference is consistent with a still-valid positive cache entry but does not prove why the record changed. If the authoritative server becomes unavailable, a resolver might answer from eligible stale data under its serve-stale policy; another resolver may return a failure. NXDOMAIN/NODATA are actual negative responses, whereas SERVFAIL/timeout indicate a different resolution outcome and have separate failure-cache rules. Serve stale Negative caching Failure cache

In practice

Record the resolver address, exact name/type, response status, returned RRset and time. Compare with direct authoritative evidence to narrow down cache, delegation or authoritative problems. Do not infer “the domain is gone” from a timeout. If validation or transport behavior is relevant, document it instead of turning off security checks for a quick successful-looking response.

The existing DNS TTL model shows one intentionally bounded resolver. See DNS change not visible for diagnosis and authoritative nameserver for the source of zone answers.

Key takeaways

A recursive resolver is an intermediary with memory and policy. Diagnose its evidence at the same question and time; separate positive data, authoritative absence and inability to resolve.

Frequently asked questions

Editorial questions, answered from the sources listed for this article.

Can a resolver still answer when the authoritative server is unavailable?

It can reuse an eligible unexpired cached answer. Once a fresh answer is needed, this model reports failure. Some real resolvers implement separately specified serve-stale behavior, which this scene excludes.

Can two recursive resolvers answer differently?

Yes. Their caches, upstream paths and policies can differ, even when they ultimately consult the same authoritative zone.

Can I identify the authoritative answer by reading one recursive response?

Not reliably. A recursive answer may be cached or stale. Query a verified authoritative source separately when authorized.

What is the difference between NXDOMAIN and SERVFAIL?

NXDOMAIN indicates a name error in a DNS response; SERVFAIL reports inability to process or resolve the question. They do not support the same inference about existence.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. RFC 1034 — Domain Names: Concepts and Facilities

    Sections 2.4, 3.1, 4.3.2 and 5. DNS tree, zones, referrals, resolvers and caching.

    Checked .

  2. RFC 9499 — DNS Terminology

    Sections 2–7. Terminology for authoritative servers, recursion, caching, and delegation.

    Checked .

  3. RFC 2308 — Negative Caching of DNS Queries

    Sections 3–6. NXDOMAIN and NODATA negative cache behavior and TTL.

    Checked .

  4. RFC 8767 — Serving Stale Data to Improve DNS Resiliency

    Sections 3–7. Conditional stale-answer behavior during authoritative DNS difficulties.

    Checked .

  5. RFC 9520 — Negative Caching of DNS Resolution Failures

    Sections 2 and 3.2; updates RFC 2308. Resolution failure is distinct from NXDOMAIN/NODATA; failure caching and retry limits are separate from positive-data lifetime.

    Checked .