1
2
3
4
5Internet Engineering Task Force (IETF) P. van Dijk
6Request for Comments: 9077 PowerDNS
7Updates: 4034, 4035, 5155, 8198 July 2021
8Category: Standards Track
9ISSN: 2070-1721
10
11
12 NSEC and NSEC3: TTLs and Aggressive Use
13
14Abstract
15
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.
21
22Status of This Memo
23
24 This is an Internet Standards Track document.
25
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.
31
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.
35
36Copyright Notice
37
38 Copyright (c) 2021 IETF Trust and the persons identified as the
39 document authors. All rights reserved.
40
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.
50
51Table of Contents
52
53 1. Introduction
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
65 Acknowledgements
66 Author's Address
67
681. Introduction
69
70 [RFC2308] defines the TTL of the Start of Authority (SOA) record that
71 must be returned in negative answers (NXDOMAIN or NODATA):
72
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.
76
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.
82
83 However, [RFC4034], Section 4 has this unfortunate text:
84
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]).
87
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.
91
92 [RFC8198], Section 5.4 tries to correct this:
93
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).
99 |
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.
104
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
109 the RFCs.
110
111 As a theoretical exercise, consider a top-level domain (TLD) named
112 .example with an SOA record like this:
113
114 example. 900 IN SOA primary.example. dnsadmin.example. (
115 1 1800 900 604800 86400 )
116
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
122 intended 15 minutes.
123
1242. Conventions and Definitions
125
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.
131
1323. NSEC and NSEC3 TTL Changes
133
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:
137
138 | However, it seems prudent for resolvers to avoid blocking new
139 | authoritative data or synthesizing new data on their own.
140
141 [RFC8198] updated that text to contain:
142
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
146 | expire.
147
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.
151
1523.1. Updates to RFC 4034
153
154 [RFC4034] says:
155
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]).
158
159 This is updated to say:
160
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
166 | TTL MAY exist.
167
1683.2. Updates to RFC 4035
169
170 [RFC4035] says:
171
172 | The TTL value for any NSEC RR SHOULD be the same as the minimum
173 | TTL value field in the zone SOA RR.
174
175 This is updated to say:
176
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
182 | TTL MAY exist.
183
1843.3. Updates to RFC 5155
185
186 [RFC5155] says:
187
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].
190
191 This is updated to say:
192
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
198 | TTL MAY exist.
199
200 Where [RFC5155] says:
201
202 | * The TTL value for any NSEC3 RR SHOULD be the same as the
203 | minimum TTL value field in the zone SOA RR.
204
205 This is updated to say:
206
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.
212
2133.4. Updates to RFC 8198
214
215 [RFC8198], Section 5.4 ("Consideration on TTL") is completely
216 replaced by the following text:
217
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.
221 |
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.
226 |
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
231 | find these values.
232
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.)
236
2374. Zone Operator Considerations
238
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.
244
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.
248
2494.1. A Note on Wildcards
250
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
256 wildcards.
257
2585. Security Considerations
259
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.
265
2666. IANA Considerations
267
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.
271
2727. Normative References
273
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>.
278
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>.
282
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>.
287
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>.
292
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>.
297
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>.
301
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>.
305
306Acknowledgements
307
308 This document was made possible with the help of the following
309 people:
310
311 * Ralph Dolmans
312
313 * Warren Kumari
314
315 * Matthijs Mekking
316
317 * Vladimir Cunat
318
319 * Matt Nordhoff
320
321 * Josh Soref
322
323 * Tim Wicinski
324
325 The author would like to explicitly thank Paul Hoffman for the
326 extensive reviews, text contributions, and help in navigating WG
327 comments.
328
329Author's Address
330
331 Peter van Dijk
332 PowerDNS
333 Den Haag
334 Netherlands
335
336 Email: peter.van.dijk@powerdns.com
337