ietf-corpus

rfc-9520

Negative Caching of DNS Resolution Failures

D. Wessels, W. Carroll, M. Thomas
date2023-12 streamIETF areaops wgdnsop statusPROPOSED STANDARD pages14 canonicalhttps://www.rfc-editor.org/rfc/rfc9520 doi10.17487/RFC9520 errataview
In the DNS, resolvers employ caching to reduce both latency for end users and load on authoritative name servers. The process of resolution may result in one of three types of responses: (1) a response containing the requested data, (2) a response indicating the requested data does not exist, or (3) a non-response due to a resolution failure in which the resolver does not receive any useful information regarding the data's existence. This document concerns itself only with the third type. RFC 2308 specifies requirements for DNS negative caching. There, caching of TYPE 2 responses is mandatory and caching of TYPE 3 responses is optional. This document updates RFC 2308 to require negative caching for DNS resolution failures. RFC 4035 allows DNSSEC validation failure caching. This document updates RFC 4035 to require caching for DNSSEC validation failures. RFC 4697 prohibits aggressive requerying for NS records at a failed zone's parent zone. This document updates RFC 4697 to expand this requirement to all query types and to all ancestor zones.

updates

Extracted elements (27)

design-rationale §1.1

Aggressive requerying by recursive resolvers during resolution failures has been empirically documented at massive scale: the 2018 DNSSEC KSK rollover caused an 80x increase (to 1.2 billion/day) in DNSKEY queries to root servers, and during the 2021 Facebook outage, .COM/.NET query traffic rose from 7,000 to 900,000 queries per second, motivating mandatory negative caching.

dns, measurement, security

design-rationale §3.2

Implementation details for the resolution failure cache are intentionally unspecified: different failure conditions may be cached differently (e.g., DNSSEC failures keyed on name/class/type, unresponsive servers keyed only on IP address). Developers should document their choices so operators know expected behavior.

dns

design-rationale §5

The 5-minute maximum cache duration for resolution failures (inherited from RFC 2308) is intentionally short to limit the impact of cache poisoning attacks that inject forged failure messages, since an attacker would need sustained spoofing throughout the backoff period and repeated attacks due to cache expiry.

dns, security

interoperability-note §2.3

Resolvers not joining multiple outstanding queries for the same <name, type, class> tuple are more susceptible to Birthday Attacks (RFC 5452 Section 5), particularly when those queries result in timeouts, because multiple outstanding queries make it easier for attackers to match DNS message parameters.

dns, security

interoperability-note §1.3

The term 'DNS transport' in this document covers classic DNS-over-UDP and DNS-over-TCP (RFC 1034, RFC 7766) as well as encrypted transports including DNS-over-TLS (RFC 7858), DNS-over-HTTPS (RFC 8484), and DNS-over-QUIC (RFC 9250). Retry-count limits apply per transport type to the same server address.

dns, tls, quic, http

interoperability-note §1

This document updates RFC 2308 to require (rather than permit) negative caching for all DNS resolution failure conditions, updates RFC 4035 to require (rather than allow) caching of DNSSEC validation failures, and updates RFC 4697 to expand the anti-requerying prohibition from NS queries at the parent zone to all query types and all ancestor zones.

dns

normative-requirement §3.1 MAY

A resolver MAY retry a given query over a different DNS transport to the same server if it has reason to believe that transport is available and compatible with its security policies.

dns

normative-requirement §3.1 MUST NOT

A resolver MUST NOT retry a given query to a server address over a given DNS transport more than twice (three queries total) before considering the server address unresponsive over that transport for that query.

dns

normative-requirement §3.2 MUST

Resolvers MUST cache resolution failures for at least 1 second and MUST NOT cache them for longer than 5 minutes, consistent with RFC 2308.

dns

normative-requirement §3.2 MUST

Resolvers MUST implement a cache for resolution failures to eliminate repeated upstream queries that cannot be resolved.

dns

normative-requirement §3.2 SHOULD

Resolvers SHOULD employ an exponential or linear backoff algorithm to increase the cache duration for persistent resolution failures, up to a configurable maximum not exceeding 5 minutes.

dns

normative-requirement §3.2 SHOULD

Resolvers SHOULD implement measures to mitigate resource exhaustion attacks on the failed resolution cache by limiting memory and/or processing time devoted to this cache.

dns, security

normative-requirement §3.4 MUST

Security-aware resolvers MUST cache DNSSEC validation failures (with restrictions on TTL). This strengthens RFC 4035 Section 4.7, which previously allowed caching with MAY.

dns, security

normative-requirement §3.2 SHOULD

The minimum cache duration for resolution failures SHOULD be configurable by the operator, balancing reduced query load against recovery time from transitory issues.

dns

normative-requirement §3.3 MUST

Upon encountering a zone whose name servers are all non-responsive, a resolver MUST cache the resolution failure and MUST limit queries to the non-responsive zone's parent zone (and all ancestor zones) just as it limits subsequent queries to the non-responsive zone itself. This updates RFC 4697 Section 2.1.1 to apply to all query types and all ancestor zones.

dns

normative-requirement §3.2 MUST NOT

When an incoming query matches a cached resolution failure, the resolver MUST NOT send any corresponding outgoing queries until after the cache entries expire.

dns

privacy-consideration §6

This specification has no impact on user privacy.

dns, privacy

protocol-element §2.4

A delegation loop occurs when two or more domains circularly reference each other's name servers in their NS RRsets, making all names under the involved zones unresolvable. Undetected loops can generate DDoS-level traffic (TsuNAME vulnerability).

dns, security

protocol-element §2

A DNS resolution failure occurs when none of the servers available to a resolver provide any useful response (requested data, referral, or indication of non-existence) for a given <name, type, class> query tuple. NXDOMAIN and NOERROR/NODATA are not resolution failures.

dns

protocol-element §2.6

A DNSSEC validation failure occurs when a security-aware resolver cannot establish a chain of trust for an RRset after trying multiple authoritative servers; causes include signature mismatch, missing DNSKEY RRs, denial-of-existence issues, and clock skew.

dns, security

protocol-element §2.5

An alias loop occurs when CNAME or DNAME records form a circular chain. RFC 1034 Section 3.6.2 requires that resolver software detect and signal CNAME loops as errors rather than failing silently.

dns

protocol-element §2.7

FORMERR (RCODE=3) is returned when a server cannot interpret the query; most commonly associated with EDNS(0) processing problems. Some recursive clients retry without EDNS(0) upon receiving FORMERR; resolution failures from FORMERR are rare.

dns

protocol-element §2.2

REFUSED (RCODE=5) is returned when a server declines to process a query for policy reasons, such as non-authoritative queries to an authoritative server or out-of-ACL sources to a recursive resolver.

dns

protocol-element §2.1

SERVFAIL (RCODE=2) is returned when a name server cannot process a query due to its own problems; authoritative servers use it when they lack valid zone data, and recursive servers use it for a variety of failure conditions including those described in this document.

dns

protocol-element §2.3

Timeouts and unreachable servers (collectively 'dead/unreachable servers' per RFC 2308) include ICMP port unreachable, TCP connection refused, TLS handshake failure, and lack of response within a timeout period. Resolvers may have both a retry-trigger timeout and a larger server-unresponsive timeout.

dns

security-consideration §5

A cache poisoning denial-of-service attack is possible because failure messages cannot be DNSSEC-signed: an attacker can forge SERVFAIL or similar responses to cause resolvers to stop querying authoritative servers. This attack requires sustained spoofing and is mitigated by the 5-minute cache limit, making effects localized and time-bounded.

dns, security

security-consideration §5

An attacker may attempt a resource exhaustion attack by sending queries for a large number of names and/or types that all result in resolution failure, exhausting the resolver's failure cache memory. Resolvers SHOULD bound memory devoted to this cache.

dns, security