7Internet Engineering Task Force (IETF) K. Fujiwara
8Request for Comments: 8198 JPRS
10Category: Standards Track Keio/WIDE
11ISSN: 2070-1721 W. Kumari
16 Aggressive Use of DNSSEC-Validated Cache
20 The DNS relies upon caching to scale; however, the cache lookup
21 generally requires an exact match. This document specifies the use
22 of NSEC/NSEC3 resource records to allow DNSSEC-validating resolvers
23 to generate negative answers within a range and positive answers from
24 wildcards. This increases performance, decreases latency, decreases
25 resource utilization on both authoritative and recursive servers, and
26 increases privacy. Also, it may help increase resilience to certain
27 DoS attacks in some circumstances.
29 This document updates RFC 4035 by allowing validating resolvers to
30 generate negative answers based upon NSEC/NSEC3 records and positive
31 answers in the presence of wildcards.
35 This is an Internet Standards Track document.
37 This document is a product of the Internet Engineering Task Force
38 (IETF). It represents the consensus of the IETF community. It has
39 received public review and has been approved for publication by the
40 Internet Engineering Steering Group (IESG). Further information on
41 Internet Standards is available in Section 2 of RFC 7841.
43 Information about the current status of this document, any errata,
44 and how to provide feedback on it may be obtained at
45 http://www.rfc-editor.org/info/rfc8198.
58Fujiwara, et al. Standards Track [Page 1]
60RFC 8198 NSEC/NSEC3 Usage July 2017
65 Copyright (c) 2017 IETF Trust and the persons identified as the
66 document authors. All rights reserved.
68 This document is subject to BCP 78 and the IETF Trust's Legal
69 Provisions Relating to IETF Documents
70 (http://trustee.ietf.org/license-info) in effect on the date of
71 publication of this document. Please review these documents
72 carefully, as they describe your rights and restrictions with respect
73 to this document. Code Components extracted from this document must
74 include Simplified BSD License text as described in Section 4.e of
75 the Trust Legal Provisions and are provided without warranty as
76 described in the Simplified BSD License.
80 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
81 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
82 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 3
83 4. Background . . . . . . . . . . . . . . . . . . . . . . . . . 4
84 5. Aggressive Use of DNSSEC-Validated Cache . . . . . . . . . . 6
85 5.1. NSEC . . . . . . . . . . . . . . . . . . . . . . . . . . 6
86 5.2. NSEC3 . . . . . . . . . . . . . . . . . . . . . . . . . . 6
87 5.3. Wildcards . . . . . . . . . . . . . . . . . . . . . . . . 6
88 5.4. Consideration on TTL . . . . . . . . . . . . . . . . . . 7
89 6. Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . 7
90 7. Update to RFC 4035 . . . . . . . . . . . . . . . . . . . . . 8
91 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
92 9. Security Considerations . . . . . . . . . . . . . . . . . . . 9
93 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 9
94 10.1. Normative References . . . . . . . . . . . . . . . . . . 9
95 10.2. Informative References . . . . . . . . . . . . . . . . . 10
96 Appendix A. Detailed Implementation Notes . . . . . . . . . . . 11
97 Appendix B. Procedure for Determining ENT vs. NXDOMAIN with NSEC 11
98 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 12
99 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 13
114Fujiwara, et al. Standards Track [Page 2]
116RFC 8198 NSEC/NSEC3 Usage July 2017
121 A DNS negative cache exists, and is used to cache the fact that an
122 RRset does not exist. This method of negative caching requires exact
123 matching; this leads to unnecessary additional lookups, increases
124 latency, leads to extra resource utilization on both authoritative
125 and recursive servers, and decreases privacy by leaking queries.
127 This document updates RFC 4035 to allow resolvers to use NSEC/NSEC3
128 resource records to synthesize negative answers from the information
129 they have in the cache. This allows validating resolvers to respond
130 with a negative answer immediately if the name in question falls into
131 a range expressed by an NSEC/NSEC3 resource record already in the
132 cache. It also allows the synthesis of positive answers in the
133 presence of wildcard records.
135 Aggressive negative caching was first proposed in Section 6 of DNSSEC
136 Lookaside Validation (DLV) [RFC5074] in order to find covering NSEC
139 [RFC8020] and [RES-IMPROVE] propose steps to using NXDOMAIN
140 information for more effective caching. This document takes this
145 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
146 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
147 "OPTIONAL" in this document are to be interpreted as described in BCP
148 14 [RFC2119] [RFC8174] when, and only when, they appear in all
149 capitals, as shown here.
151 Many of the specialized terms used in this document are defined in
152 DNS Terminology [RFC7719].
154 The key words "source of synthesis" in this document are to be
155 interpreted as described in [RFC4592].
159 The DNS negative cache caches negative (non-existent) information,
160 and requires an exact match in most instances [RFC2308].
162 Assume that the (DNSSEC-signed) "example.com" zone contains:
164 albatross.example.com. IN A 192.0.2.1
165 elephant.example.com. IN A 192.0.2.2
166 zebra.example.com. IN A 192.0.2.3
170Fujiwara, et al. Standards Track [Page 3]
172RFC 8198 NSEC/NSEC3 Usage July 2017
175 If a validating resolver receives a query for cat.example.com, it
176 contacts its resolver (which may be itself) to query the example.com
177 servers and will get back an NSEC record stating that there are no
178 records (alphabetically) between albatross and elephant, or an NSEC3
179 record stating there is nothing between two hashed names. The
180 resolver then knows that cat.example.com does not exist; however, it
181 does not use the fact that the proof covers a range (albatross to
182 elephant) to suppress queries for other labels that fall within this
183 range. This means that if the validating resolver gets a query for
184 ball.example.com (or dog.example.com) it will once again go off and
185 query the example.com servers for these names.
187 Apart from wasting bandwidth, this also wastes resources on the
188 recursive server (it needs to keep state for outstanding queries),
189 wastes resources on the authoritative server (it has to answer
190 additional questions), increases latency (the end user has to wait
191 longer than necessary to get back an NXDOMAIN answer), can be used by
192 attackers to cause a DoS, and also has privacy implications (e.g.,
193 typos leak out further than necessary).
195 Another example: assume that the (DNSSEC-signed) "example.org" zone
198 avocado.example.org. IN A 192.0.2.1
199 *.example.org. IN A 192.0.2.2
200 zucchini.example.org. IN A 192.0.2.3
202 If a query is received for leek.example.org, the system contacts its
203 resolver (which may be itself) to query the example.org servers and
204 will get back an NSEC record stating that there are no records
205 (alphabetically) between avocado and zucchini (or an NSEC3 record
206 stating there is nothing between two hashed names), as well as an
207 answer for leek.example.org, with the label count of the signature
208 set to two (see [RFC7129], Section 5.3 for more details).
210 If the validating resolver gets a query for banana.example.org, it
211 will once again go off and query the example.org servers for
212 banana.example.org (even though it already has proof that there is a
213 wildcard record) -- just like above, this has privacy implications,
214 wastes resources, can be used to contribute to a DoS, etc.
218 DNSSEC [RFC4035] and [RFC5155] both provide "authenticated denial of
219 existence"; this is a cryptographic proof that the queried-for name
220 does not exist or the type does not exist. Proof that a name does
221 not exist is accomplished by providing a (DNSSEC-secured) record
222 containing the names that appear alphabetically before and after the
226Fujiwara, et al. Standards Track [Page 4]
228RFC 8198 NSEC/NSEC3 Usage July 2017
231 queried-for name. In the first example above, if the (DNSSEC-
232 validating) recursive server were to query for dog.example.com, it
233 would receive a (signed) NSEC record stating that there are no labels
234 between "albatross" and "elephant" (or, for NSEC3, a similar pair of
235 hashed names). This is a signed, cryptographic proof that these
236 names are the ones before and after the queried-for label. As
237 dog.example.com falls within this range, the recursive server knows
238 that dog.example.com really does not exist. Proof that a type does
239 not exist is accomplished by providing a (DNSSEC-secured) record
240 containing the queried-for name, and a type bitmap that does not
241 include the requested type.
243 This document specifies that this NSEC/NSEC3 record should be used to
244 generate negative answers for any queries that the validating server
245 receives that fall within the range covered by the record (for the
246 TTL for the record). This document also specifies that a positive
247 answer should be generated for any queries that the validating server
248 receives that are proven to be covered by a wildcard record.
250 Section 4.5 of [RFC4035] says:
252 In theory, a resolver could use wildcards or NSEC RRs to generate
253 positive and negative responses (respectively) until the TTL or
254 signatures on the records in question expire. However, it seems
255 prudent for resolvers to avoid blocking new authoritative data or
256 synthesizing new data on their own. Resolvers that follow this
257 recommendation will have a more consistent view of the namespace.
259 And, earlier, Section 4.5 of [RFC4035] says:
261 The reason for these recommendations is that, between the initial
262 query and the expiration of the data from the cache, the
263 authoritative data might have been changed (for example, via
266 In other words, if a resolver generates negative answers from an NSEC
267 record, it will not send any queries for names within that NSEC range
268 (for the TTL). If a new name is added to the zone during this
269 interval, the resolver will not know this. Similarly, if the
270 resolver is generating responses from a wildcard record, it will
271 continue to do so (for the TTL).
273 We believe that this recommendation can be relaxed because, in the
274 absence of this technique, a lookup for the exact name could have
275 come in during this interval, and so a negative answer could already
276 be cached (see [RFC2308] for more background). This means that zone
277 operators should have no expectation that an added name would work
278 immediately. With DNSSEC and aggressive use of DNSSEC-validated
282Fujiwara, et al. Standards Track [Page 5]
284RFC 8198 NSEC/NSEC3 Usage July 2017
287 cache, the TTL of the NSEC/NSEC3 record and the SOA.MINIMUM field are
288 the authoritative statement of how quickly a name can start working
2915. Aggressive Use of DNSSEC-Validated Cache
293 This document relaxes the restriction given in Section 4.5 of
294 [RFC4035]. See Section 7 for more detail.
296 If the negative cache of the validating resolver has sufficient
297 information to validate the query, the resolver SHOULD use NSEC,
298 NSEC3, and wildcard records to synthesize answers as described in
299 this document. Otherwise, it MUST fall back to send the query to the
300 authoritative DNS servers.
304 The validating resolver needs to check the existence of an NSEC RR
305 matching/covering the source of synthesis and an NSEC RR covering the
308 If denial of existence can be determined according to the rules set
309 out in Section 5.4 of [RFC4035], using NSEC records in the cache,
310 then the resolver can immediately return an NXDOMAIN or NODATA (as
311 appropriate) response.
315 NSEC3 aggressive negative caching is more difficult than NSEC
316 aggressive caching. If the zone is signed with NSEC3, the validating
317 resolver needs to check the existence of non-terminals and wildcards
318 that derive from query names.
320 If denial of existence can be determined according to the rules set
321 out in [RFC5155], Sections 8.4, 8.5, 8.6, and 8.7, using NSEC3
322 records in the cache, then the resolver can immediately return an
323 NXDOMAIN or NODATA response (as appropriate).
325 If a covering NSEC3 RR has an Opt-Out flag, the covering NSEC3 RR
326 does not prove the non-existence of the domain name and the
327 aggressive negative caching is not possible for the domain name.
331 The last paragraph of [RFC4035], Section 4.5 also discusses the use
332 of wildcards and NSEC RRs to generate positive responses and
333 recommends that it not be relied upon. Just like the case for the
338Fujiwara, et al. Standards Track [Page 6]
340RFC 8198 NSEC/NSEC3 Usage July 2017
343 aggressive use of NSEC/NSEC3 for negative answers, we revise this
346 As long as the validating resolver can determine that a name would
347 not exist without the wildcard match, determined according to the
348 rules set out in Section 5.3.4 of [RFC4035] (NSEC), or in Section 8.8
349 of [RFC5155], it SHOULD synthesize an answer (or NODATA response) for
350 that name using the cache-deduced wildcard. If the corresponding
351 wildcard record is not in the cache, it MUST fall back to send the
352 query to the authoritative DNS servers.
3545.4. Consideration on TTL
356 The TTL value of negative information is especially important,
357 because newly added domain names cannot be used while the negative
358 information is effective.
360 Section 5 of [RFC2308] suggests a maximum default negative cache TTL
361 value of 3 hours (10800). It is RECOMMENDED that validating
362 resolvers limit the maximum effective TTL value of negative responses
363 (NSEC/NSEC3 RRs) to this same value.
365 Section 5 of [RFC2308] also states that a negative cache entry TTL is
366 taken from the minimum of the SOA.MINIMUM field and SOA's TTL. This
367 can be less than the TTL of an NSEC or NSEC3 record, since their TTL
368 is equal to the SOA.MINIMUM field (see [RFC4035], Section 2.3 and
369 [RFC5155], Section 3).
371 A resolver that supports aggressive use of NSEC and NSEC3 SHOULD
372 reduce the TTL of NSEC and NSEC3 records to match the SOA.MINIMUM
373 field in the authority section of a negative response, if SOA.MINIMUM
378 The techniques described in this document provide a number of
379 benefits, including (in no specific order):
381 Reduced latency: By answering directly from cache, validating
382 resolvers can immediately inform clients that the name they are
383 looking for does not exist, improving the user experience.
385 Decreased recursive server load: By answering queries from the cache
386 by synthesizing answers, validating servers avoid having to send a
387 query and wait for a response. In addition to decreasing the
388 bandwidth used, it also means that the server does not need to
389 allocate and maintain state, thereby decreasing memory and CPU
394Fujiwara, et al. Standards Track [Page 7]
396RFC 8198 NSEC/NSEC3 Usage July 2017
399 Decreased authoritative server load: Because recursive servers can
400 answer queries without asking the authoritative server, the
401 authoritative servers receive fewer queries. This decreases the
402 authoritative server bandwidth, queries per second, and CPU
405 The scale of the benefit depends upon multiple factors, including the
406 query distribution. For example, at the time of this writing, around
407 65% of queries to root name servers result in NXDOMAIN responses (see
408 statistics from [ROOT-SERVERS]); this technique will eliminate a
409 sizable quantity of these.
411 The technique described in this document may also mitigate so-called
412 "random QNAME attacks", in which attackers send many queries for
413 random subdomains to resolvers. As the resolver will not have the
414 answers cached, it has to ask external servers for each random query,
415 leading to a DoS on the authoritative servers (and often resolvers).
416 The technique may help mitigate these attacks by allowing the
417 resolver to answer directly from the cache for any random queries
418 that fall within already requested ranges. It will not always work
419 as an effective defense, not least because not many zones are DNSSEC
420 signed at all -- but it will still provide an additional layer of
423 As these benefits are only accrued by those using DNSSEC, it is hoped
424 that these techniques will lead to more DNSSEC deployment.
428 Section 4.5 of [RFC4035] shows that "In theory, a resolver could use
429 wildcards or NSEC RRs to generate positive and negative responses
430 (respectively) until the TTL or signatures on the records in question
431 expire. However, it seems prudent for resolvers to avoid blocking
432 new authoritative data or synthesizing new data on their own.
433 Resolvers that follow this recommendation will have a more consistent
434 view of the namespace".
436 The paragraph is updated as follows:
438 +-----------------------------------------------------------------+
439 | Once the records are validated, DNSSEC-enabled validating |
440 | resolvers SHOULD use wildcards and NSEC/NSEC3 resource records |
441 | to generate positive and negative responses until the |
442 | effective TTLs or signatures for those records expire. |
443 +-----------------------------------------------------------------+
450Fujiwara, et al. Standards Track [Page 8]
452RFC 8198 NSEC/NSEC3 Usage July 2017
4558. IANA Considerations
457 This document does not require any IANA actions.
4599. Security Considerations
461 Use of NSEC/NSEC3 resource records without DNSSEC validation may
462 create serious security issues, and so this technique requires DNSSEC
465 Newly registered resource records may not be used immediately.
466 However, choosing a suitable TTL value and a negative cache TTL value
467 (SOA.MINIMUM field) will mitigate the delay concern, and it is not a
470 It is also suggested to limit the maximum TTL value of NSEC/NSEC3
471 resource records in the negative cache to, for example, 10800 seconds
472 (3 hours), to mitigate this issue.
474 Although the TTL of NSEC/NSEC3 records is typically fairly short
475 (minutes or hours), their RRSIG expiration time can be much further
476 in the future (weeks). An attacker who is able to successfully spoof
477 responses might poison a cache with old NSEC/NSEC3 records. If the
478 resolver is not making aggressive use of NSEC/NSEC3, the attacker has
479 to repeat the attack for every query. If the resolver is making
480 aggressive use of NSEC/NSEC3, one successful attack would be able to
481 suppress many queries for new names, up to the negative TTL.
48510.1. Normative References
487 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
488 Requirement Levels", BCP 14, RFC 2119,
489 DOI 10.17487/RFC2119, March 1997,
490 <http://www.rfc-editor.org/info/rfc2119>.
492 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS
493 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998,
494 <http://www.rfc-editor.org/info/rfc2308>.
496 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S.
497 Rose, "Protocol Modifications for the DNS Security
498 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005,
499 <http://www.rfc-editor.org/info/rfc4035>.
506Fujiwara, et al. Standards Track [Page 9]
508RFC 8198 NSEC/NSEC3 Usage July 2017
511 [RFC4592] Lewis, E., "The Role of Wildcards in the Domain Name
512 System", RFC 4592, DOI 10.17487/RFC4592, July 2006,
513 <http://www.rfc-editor.org/info/rfc4592>.
515 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS
516 Security (DNSSEC) Hashed Authenticated Denial of
517 Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008,
518 <http://www.rfc-editor.org/info/rfc5155>.
520 [RFC7129] Gieben, R. and W. Mekking, "Authenticated Denial of
521 Existence in the DNS", RFC 7129, DOI 10.17487/RFC7129,
522 February 2014, <http://www.rfc-editor.org/info/rfc7129>.
524 [RFC7719] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS
525 Terminology", RFC 7719, DOI 10.17487/RFC7719, December
526 2015, <http://www.rfc-editor.org/info/rfc7719>.
528 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
529 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
530 May 2017, <http://www.rfc-editor.org/info/rfc8174>.
53210.2. Informative References
535 Vixie, P., Joffe, R., and F. Neves, "Improvements to DNS
536 Resolvers for Resiliency, Robustness, and Responsiveness",
537 Work in Progress, draft-vixie-dnsext-resimprove-00, June
540 [RFC5074] Weiler, S., "DNSSEC Lookaside Validation (DLV)", RFC 5074,
541 DOI 10.17487/RFC5074, November 2007,
542 <http://www.rfc-editor.org/info/rfc5074>.
544 [RFC8020] Bortzmeyer, S. and S. Huque, "NXDOMAIN: There Really Is
545 Nothing Underneath", RFC 8020, DOI 10.17487/RFC8020,
546 November 2016, <http://www.rfc-editor.org/info/rfc8020>.
549 "Root Server Technical Operations Assn",
550 <http://www.root-servers.org/>.
562Fujiwara, et al. Standards Track [Page 10]
564RFC 8198 NSEC/NSEC3 Usage July 2017
567Appendix A. Detailed Implementation Notes
569 o Previously, cached negative responses were indexed by QNAME,
570 QCLASS, QTYPE, and the setting of the CD bit (see RFC 4035,
571 Section 4.7), and only queries matching the index key would be
572 answered from the cache. With aggressive negative caching, the
573 validator, in addition to checking to see if the answer is in its
574 cache before sending a query, checks to see whether any cached and
575 validated NSEC record denies the existence of the sought
576 record(s). Using aggressive negative caching, a validator will
577 not make queries for any name covered by a cached and validated
578 NSEC record. Furthermore, a validator answering queries from
579 clients will synthesize a negative answer (or NODATA response)
580 whenever it has an applicable validated NSEC in its cache unless
581 the CD bit was set on the incoming query. (Imported from
582 Section 6 of [RFC5074].)
584 o Implementing aggressive negative caching suggests that a validator
585 will need to build an ordered data structure of NSEC and NSEC3
586 records for each signer domain name of NSEC/NSEC3 records in order
587 to efficiently find covering NSEC/NSEC3 records. Call the table
588 as "NSEC_TABLE". (Imported from Section 6.1 of [RFC5074] and
591 o The aggressive negative caching may be inserted at the cache
592 lookup part of the recursive resolvers.
594 o If errors happen in an aggressive negative caching algorithm,
595 resolvers MUST fall back to resolve the query as usual. "Resolve
596 the query as usual" means that the resolver must process the query
597 as though it does not implement aggressive negative caching.
599Appendix B. Procedure for Determining ENT vs. NXDOMAIN with NSEC
601 This procedure outlines how to determine if a given name does not
602 exist, or is an ENT (empty non-terminal; see [RFC5155], Section 1.3)
605 If the NSEC record has not been verified as secure, discard it.
607 If the given name sorts before or matches the NSEC owner name,
608 discard it as it does not prove the NXDOMAIN or ENT.
610 If the given name is a subdomain of the NSEC owner name and the NS
611 bit is present and the SOA bit is absent, then discard the NSEC as it
612 is from a parent zone.
618Fujiwara, et al. Standards Track [Page 11]
620RFC 8198 NSEC/NSEC3 Usage July 2017
623 If the next domain name sorts after the NSEC owner name and the given
624 name sorts after or matches next domain name, then discard the NSEC
625 record as it does not prove the NXDOMAIN or ENT.
627 If the next domain name sorts before or matches the NSEC owner name
628 and the given name is not a subdomain of the next domain name, then
629 discard the NSEC as it does not prove the NXDOMAIN or ENT.
631 You now have an NSEC record that proves the NXDOMAIN or ENT.
633 If the next domain name is a subdomain of the given name, you have an
634 ENT. Otherwise, you have an NXDOMAIN.
638 The authors gratefully acknowledge DNSSEC Lookaside Validation (DLV)
639 [RFC5074] author Samuel Weiler and the Unbound developers.
641 Thanks to Mark Andrews for providing the helpful notes for
642 implementors provided in Appendix B.
644 The authors would like to specifically thank Stephane Bortzmeyer (for
645 standing next to and helping edit), Ralph Dolmans, Tony Finch, Tatuya
646 JINMEI for extensive review and comments, and also Mark Andrews,
647 Casey Deccio, Alexander Dupuy, Olafur Gudmundsson, Bob Harold, Shumon
648 Huque, John Levine, Pieter Lexis, Matthijs Mekking (who even sent
649 pull requests!), and Ondrej Sury.
674Fujiwara, et al. Standards Track [Page 12]
676RFC 8198 NSEC/NSEC3 Usage July 2017
682 Japan Registry Services Co., Ltd.
683 Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda
684 Chiyoda-ku, Tokyo 101-0065
687 Phone: +81 3 5215 8451
688 Email: fujiwara@jprs.co.jp
692 Keio University/WIDE Project
693 Graduate School of Media Design, 4-1-1 Hiyoshi
694 Kohoku, Yokohama 223-8526
697 Phone: +81 45 564 2490
698 Email: kato@wide.ad.jp
703 1600 Amphitheatre Parkway
704 Mountain View, CA 94043
705 United States of America
707 Email: warren@kumari.net
730Fujiwara, et al. Standards Track [Page 13]