5Internet Engineering Task Force (IETF)                       P. van Dijk
 
6Request for Comments: 9077                                      PowerDNS
 
7Updates: 4034, 4035, 5155, 8198                                July 2021
 
8Category: Standards Track                                               
 
12                NSEC and NSEC3: TTLs and Aggressive Use
 
16   Due to a combination of unfortunate wording in earlier documents,
 
17   aggressive use of NSEC and NSEC3 records may deny the existence of
 
18   names far beyond the intended lifetime of a denial.  This document
 
19   changes the definition of the NSEC and NSEC3 TTL to correct that
 
20   situation.  This document updates RFCs 4034, 4035, 5155, and 8198.
 
24   This is an Internet Standards Track document.
 
26   This document is a product of the Internet Engineering Task Force
 
27   (IETF).  It represents the consensus of the IETF community.  It has
 
28   received public review and has been approved for publication by the
 
29   Internet Engineering Steering Group (IESG).  Further information on
 
30   Internet Standards is available in Section 2 of RFC 7841.
 
32   Information about the current status of this document, any errata,
 
33   and how to provide feedback on it may be obtained at
 
34   https://www.rfc-editor.org/info/rfc9077.
 
38   Copyright (c) 2021 IETF Trust and the persons identified as the
 
39   document authors.  All rights reserved.
 
41   This document is subject to BCP 78 and the IETF Trust's Legal
 
42   Provisions Relating to IETF Documents
 
43   (https://trustee.ietf.org/license-info) in effect on the date of
 
44   publication of this document.  Please review these documents
 
45   carefully, as they describe your rights and restrictions with respect
 
46   to this document.  Code Components extracted from this document must
 
47   include Simplified BSD License text as described in Section 4.e of
 
48   the Trust Legal Provisions and are provided without warranty as
 
49   described in the Simplified BSD License.
 
54   2.  Conventions and Definitions
 
55   3.  NSEC and NSEC3 TTL Changes
 
56     3.1.  Updates to RFC 4034
 
57     3.2.  Updates to RFC 4035
 
58     3.3.  Updates to RFC 5155
 
59     3.4.  Updates to RFC 8198
 
60   4.  Zone Operator Considerations
 
61     4.1.  A Note on Wildcards
 
62   5.  Security Considerations
 
63   6.  IANA Considerations
 
64   7.  Normative References
 
70   [RFC2308] defines the TTL of the Start of Authority (SOA) record that
 
71   must be returned in negative answers (NXDOMAIN or NODATA):
 
73   |  The TTL of this record is set from the minimum of the MINIMUM
 
74   |  field of the SOA record and the TTL of the SOA itself, and
 
75   |  indicates how long a resolver may cache the negative answer.
 
77   Thus, if the TTL of the SOA in the zone is lower than the SOA MINIMUM
 
78   value (the last number in the SOA record), the authoritative server
 
79   sends that lower value as the TTL of the returned SOA record.  The
 
80   resolver always uses the TTL of the returned SOA record when setting
 
81   the negative TTL in its cache.
 
83   However, [RFC4034], Section 4 has this unfortunate text:
 
85   |  The NSEC RR SHOULD have the same TTL value as the SOA minimum TTL
 
86   |  field.  This is in the spirit of negative caching ([RFC2308]).
 
88   This text, while referring to [RFC2308], can cause NSEC records to
 
89   have much higher TTLs than the appropriate negative TTL for a zone.
 
90   [RFC5155] contains equivalent text.
 
92   [RFC8198], Section 5.4 tries to correct this:
 
94   |  Section 5 of [RFC2308] also states that a negative cache entry TTL
 
95   |  is taken from the minimum of the SOA.MINIMUM field and SOA's TTL.
 
96   |  This can be less than the TTL of an NSEC or NSEC3 record, since
 
97   |  their TTL is equal to the SOA.MINIMUM field (see [RFC4035],
 
98   |  Section 2.3 and [RFC5155], Section 3).
 
100   |  A resolver that supports aggressive use of NSEC and NSEC3 SHOULD
 
101   |  reduce the TTL of NSEC and NSEC3 records to match the SOA.MINIMUM
 
102   |  field in the authority section of a negative response, if
 
103   |  SOA.MINIMUM is smaller.
 
105   But the NSEC and NSEC3 RRs should, according to [RFC4034] and
 
106   [RFC5155], already be at the value of the MINIMUM field in the SOA.
 
107   Thus, the advice from [RFC8198] would not actually change the TTL
 
108   used for the NSEC and NSEC3 RRs for authoritative servers that follow
 
111   As a theoretical exercise, consider a top-level domain (TLD) named
 
112   .example with an SOA record like this:
 
114   example.    900 IN  SOA primary.example. dnsadmin.example. (
 
115                                            1 1800 900 604800 86400 )
 
117   The SOA record has a 900-second TTL and an 86400-second MINIMUM TTL.
 
118   Negative responses from this zone have a 900-second TTL, but the NSEC
 
119   or NSEC3 records in those negative responses have an 86400-second
 
120   TTL.  If a resolver were to use those NSEC or NSEC3 records
 
121   aggressively, they would be considered valid for a day instead of the
 
1242.  Conventions and Definitions
 
126   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 
127   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
 
128   "OPTIONAL" in this document are to be interpreted as described in
 
129   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
 
130   capitals, as shown here.
 
1323.  NSEC and NSEC3 TTL Changes
 
134   [RFC4034], [RFC4035], and [RFC5155] use the SHOULD requirement level,
 
135   but they were written prior to the publication of [RFC8198] when
 
136   [RFC4035] still said:
 
138   |  However, it seems prudent for resolvers to avoid blocking new
 
139   |  authoritative data or synthesizing new data on their own.
 
141   [RFC8198] updated that text to contain:
 
143   |  ...DNSSEC-enabled validating resolvers SHOULD use wildcards and
 
144   |  NSEC/NSEC3 resource records to generate positive and negative
 
145   |  responses until the effective TTLs or signatures for those records
 
148   This means that the correctness of NSEC and NSEC3 records and their
 
149   TTLs has become much more important.  Because of that, the updates in
 
150   this document upgrade the requirement level to MUST.
 
1523.1.  Updates to RFC 4034
 
156   |  The NSEC RR SHOULD have the same TTL value as the SOA minimum TTL
 
157   |  field.  This is in the spirit of negative caching ([RFC2308]).
 
159   This is updated to say:
 
161   |  The TTL of the NSEC RR that is returned MUST be the lesser of the
 
162   |  MINIMUM field of the SOA record and the TTL of the SOA itself.
 
163   |  This matches the definition of the TTL for negative responses in
 
164   |  [RFC2308].  Because some signers incrementally update the NSEC
 
165   |  chain, a transient inconsistency between the observed and expected
 
1683.2.  Updates to RFC 4035
 
172   |  The TTL value for any NSEC RR SHOULD be the same as the minimum
 
173   |  TTL value field in the zone SOA RR.
 
175   This is updated to say:
 
177   |  The TTL of the NSEC RR that is returned MUST be the lesser of the
 
178   |  MINIMUM field of the SOA record and the TTL of the SOA itself.
 
179   |  This matches the definition of the TTL for negative responses in
 
180   |  [RFC2308].  Because some signers incrementally update the NSEC
 
181   |  chain, a transient inconsistency between the observed and expected
 
1843.3.  Updates to RFC 5155
 
188   |  The NSEC3 RR SHOULD have the same TTL value as the SOA minimum TTL
 
189   |  field.  This is in the spirit of negative caching [RFC2308].
 
191   This is updated to say:
 
193   |  The TTL of the NSEC3 RR that is returned MUST be the lesser of the
 
194   |  MINIMUM field of the SOA record and the TTL of the SOA itself.
 
195   |  This matches the definition of the TTL for negative responses in
 
196   |  [RFC2308].  Because some signers incrementally update the NSEC3
 
197   |  chain, a transient inconsistency between the observed and expected
 
200   Where [RFC5155] says:
 
202   |  *  The TTL value for any NSEC3 RR SHOULD be the same as the
 
203   |     minimum TTL value field in the zone SOA RR.
 
205   This is updated to say:
 
207   |  *  The TTL value for each NSEC3 RR MUST be the lesser of the
 
208   |     MINIMUM field of the zone SOA RR and the TTL of the zone SOA RR
 
209   |     itself.  Because some signers incrementally update the NSEC3
 
210   |     chain, a transient inconsistency between the observed and
 
211   |     expected TTL MAY exist.
 
2133.4.  Updates to RFC 8198
 
215   [RFC8198], Section 5.4 ("Consideration on TTL") is completely
 
216   replaced by the following text:
 
218   |  The TTL value of negative information is especially important,
 
219   |  because newly added domain names cannot be used while the negative
 
220   |  information is effective.
 
222   |  Section 5 of [RFC2308] suggests a maximum default negative cache
 
223   |  TTL value of 3 hours (10800).  It is RECOMMENDED that validating
 
224   |  resolvers limit the maximum effective TTL value of negative
 
225   |  responses (NSEC/NSEC3 RRs) to this same value.
 
227   |  A resolver that supports aggressive use of NSEC and NSEC3 MAY
 
228   |  limit the TTL of NSEC and NSEC3 records to the lesser of the
 
229   |  SOA.MINIMUM field and the TTL of the SOA in a response, if
 
230   |  present.  It MAY also use a previously cached SOA for a zone to
 
233   (The third paragraph of the original is removed, and the fourth
 
234   paragraph is updated to allow resolvers to also take the lesser of
 
235   the SOA TTL and SOA MINIMUM.)
 
2374.  Zone Operator Considerations
 
239   If signers and DNS servers for a zone cannot immediately be updated
 
240   to conform to this document, zone operators are encouraged to
 
241   consider setting their SOA record TTL and the SOA MINIMUM field to
 
242   the same value.  That way, the TTL used for aggressive NSEC and NSEC3
 
243   use matches the SOA TTL for negative responses.
 
245   Note that some signers might use the SOA TTL or MINIMUM as a default
 
246   for other values, such as the TTL for DNSKEY records.  Operators
 
247   should consult documentation before changing values.
 
2494.1.  A Note on Wildcards
 
251   Validating resolvers consider an expanded wildcard valid for the
 
252   wildcard's TTL, capped by the TTLs of the NSEC or NSEC3 proof that
 
253   shows that the wildcard expansion is legal.  Thus, changing the TTL
 
254   of NSEC or NSEC3 records (explicitly, or by implementation of this
 
255   document implicitly) might affect (shorten) the lifetime of
 
2585.  Security Considerations
 
260   An attacker can delay future records from appearing in a cache by
 
261   seeding the cache with queries that cause NSEC or NSEC3 responses to
 
262   be cached for aggressive use purposes.  This document reduces the
 
263   impact of that attack in cases where the NSEC or NSEC3 TTL is higher
 
264   than the zone operator intended.
 
2666.  IANA Considerations
 
268   IANA has added a reference to this document in the "Resource Record
 
269   (RR) TYPEs" subregistry of the "Domain Name System (DNS) Parameters"
 
270   registry for the NSEC and NSEC3 types.
 
2727.  Normative References
 
274   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
 
275              Requirement Levels", BCP 14, RFC 2119,
 
276              DOI 10.17487/RFC2119, March 1997,
 
277              <https://www.rfc-editor.org/info/rfc2119>.
 
279   [RFC2308]  Andrews, M., "Negative Caching of DNS Queries (DNS
 
280              NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998,
 
281              <https://www.rfc-editor.org/info/rfc2308>.
 
283   [RFC4034]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
 
284              Rose, "Resource Records for the DNS Security Extensions",
 
285              RFC 4034, DOI 10.17487/RFC4034, March 2005,
 
286              <https://www.rfc-editor.org/info/rfc4034>.
 
288   [RFC4035]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
 
289              Rose, "Protocol Modifications for the DNS Security
 
290              Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005,
 
291              <https://www.rfc-editor.org/info/rfc4035>.
 
293   [RFC5155]  Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS
 
294              Security (DNSSEC) Hashed Authenticated Denial of
 
295              Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008,
 
296              <https://www.rfc-editor.org/info/rfc5155>.
 
298   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
 
299              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
 
300              May 2017, <https://www.rfc-editor.org/info/rfc8174>.
 
302   [RFC8198]  Fujiwara, K., Kato, A., and W. Kumari, "Aggressive Use of
 
303              DNSSEC-Validated Cache", RFC 8198, DOI 10.17487/RFC8198,
 
304              July 2017, <https://www.rfc-editor.org/info/rfc8198>.
 
308   This document was made possible with the help of the following
 
325   The author would like to explicitly thank Paul Hoffman for the
 
326   extensive reviews, text contributions, and help in navigating WG
 
336   Email: peter.van.dijk@powerdns.com