idnits 2.17.1 draft-ietf-dnsop-nxdomain-cut-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 4 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The draft header indicates that this document updates RFC1034, but the abstract doesn't seem to directly say this. It does mention RFC1034 though, so this could be OK. -- The draft header indicates that this document updates RFC2308, but the abstract doesn't seem to directly say this. It does mention RFC2308 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC1034, updated by this document, for RFC5378 checks: 1987-11-01) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 8, 2016) is 2903 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 399 -- Looks like a reference, but probably isn't: '2' on line 401 -- Looks like a reference, but probably isn't: '3' on line 403 -- Obsolete informational reference (is this intentional?): RFC 6982 (Obsoleted by RFC 7942) -- Obsolete informational reference (is this intentional?): RFC 7719 (Obsoleted by RFC 8499) -- Obsolete informational reference (is this intentional?): RFC 7816 (Obsoleted by RFC 9156) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Domain Name System Operations (dnsop) Working Group S. Bortzmeyer 3 Internet-Draft AFNIC 4 Updates: 1034, 2308 (if approved) S. Huque 5 Intended status: Standards Track Verisign Labs 6 Expires: November 9, 2016 May 8, 2016 8 NXDOMAIN really means there is nothing underneath 9 draft-ietf-dnsop-nxdomain-cut-03 11 Abstract 13 This document states clearly that when a DNS resolver receives a 14 response with response code of NXDOMAIN, it means that the domain 15 name which is thus denied AND ALL THE NAMES UNDER IT do not exist. 17 REMOVE BEFORE PUBLICATION: this document should be discussed in the 18 IETF DNSOP (DNS Operations) group, through its mailing list. The 19 source of the document, as well as a list of open issues, is 20 currently kept at Github [1]. 22 This documents clarifies RFC 1034 and modifies a bit RFC 2308 so it 23 updates both of them. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on November 9, 2016. 42 Copyright Notice 44 Copyright (c) 2016 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction and background . . . . . . . . . . . . . . . . . 2 60 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 62 3. Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . 5 63 4. Possible issues . . . . . . . . . . . . . . . . . . . . . . . 5 64 5. Implementation considerations . . . . . . . . . . . . . . . . 6 65 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 66 7. Security Considerations . . . . . . . . . . . . . . . . . . . 6 67 8. Implementation status - RFC EDITOR: REMOVE BEFORE PUBLICATION 7 68 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 69 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 70 10.1. Normative References . . . . . . . . . . . . . . . . . . 8 71 10.2. Informative References . . . . . . . . . . . . . . . . . 8 72 10.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 9 73 Appendix A. Why can't we just use the owner name of the returned 74 SOA? . . . . . . . . . . . . . . . . . . . . . . . . 9 75 Appendix B. Related approaches . . . . . . . . . . . . . . . . . 10 76 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 78 1. Introduction and background 80 The DNS protocol [RFC1035] defines response code 3 as "Name Error", 81 or "NXDOMAIN" [RFC2308], which means that the queried domain name 82 does not exist in the DNS. Since domain names are represented as a 83 tree of labels ([RFC1034], Section 3.1), non-existence of a node 84 implies non-existence of the entire sub-tree rooted at this node. 86 The DNS iterative resolution algorithm precisely interprets the 87 NXDOMAIN signal in this manner. If it encounters an NXDOMAIN 88 response code from an authoritative server, it immediately stops 89 iteration and returns the NXDOMAIN response to the querier. 91 However, in most known existing resolvers today, a cached non- 92 existence for a domain is not considered "proof" that there can be no 93 child domains underneath. This is due to an ambiguity in [RFC1034] 94 that failed to distinguish Empty Non-Terminal names (ENT) ([RFC7719]) 95 from nonexistent names. The distinction became especially important 96 for the development of DNSSEC, which provides proof of non-existence. 98 [RFC4035], section 3.1.3.2, describes how security-aware 99 authoritative name servers make the distinction, but no existing RFCs 100 describe the behavior for recursive name servers. 102 This document specifies that an NXDOMAIN response for a domain name 103 means that no child domains underneath the queried name exist either. 104 And furthermore, that DNS resolvers should interpret cached non- 105 existence in this manner. Since the domain names are organized in a 106 tree, it is a simple consequence of the tree structure: non-existence 107 of a node implies non-existence of the entire sub-tree rooted at this 108 node. 110 1.1. Terminology 112 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 113 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 114 document are to be interpreted as described in [RFC2119]. 116 "Denied name": the domain name whose existence has been denied by a 117 response of rcode NXDOMAIN. In most cases, it is the QNAME but, 118 because of [RFC6604], it is not always the case. 120 Other terms are defined in [RFC1034] or [RFC1035] or (like NXDOMAIN 121 itself) in the more recent [RFC7719]. 123 The domain name space is conceptually defined in terms of a tree 124 structure. The implementation of a DNS resolver/cache MAY use a tree 125 or other data structures. The cache being a subset of the data in 126 the domain name space, it is much easier to reason about it in terms 127 of that tree structure and to describe things in those terms (names 128 under/above, descendent names, subtrees etc). In fact, the DNS 129 algorithm description in [RFC1034] even states an assumption that the 130 cache is a tree structure, so the precedent is already well 131 established: see its section 4.3.2 which says "The following 132 algorithm assumes that the RRs are organized in several tree 133 structures, one for each zone, and another for the cache..." So, in 134 this document, each time we talk of a tree or tree operations, it 135 refers to the model, not to the actual implementation. 137 2. Rules 139 When an iterative caching DNS resolver receives a response NXDOMAIN, 140 it SHOULD store it in its cache and all names and RRsets at or below 141 that node SHOULD then be considered to be unreachable. Subsequent 142 queries for such names SHOULD elicit an NXDOMAIN response. 144 But if a resolver has cached data under the NXDOMAIN cut, it MAY 145 continue to send it as a reply. (Until the TTL of this cached data 146 expires.) 148 Another exception is that a validating resolver MAY decide to 149 implement this behaviour only when the NXDOMAIN response has been 150 validated with DNSSEC. See Section 7 for the rationale. 152 As an example of the consequence of these rules, consider two 153 successive queries to a resolver, with a non-existing domain 154 'foo.example': the first is for 'foo.example' (which results in an 155 NXDOMAIN) and the second for 'bar.foo.example' (which also results in 156 an NXDOMAIN). Many resolvers today will forward both queries, as 157 noticed in Section 8. However, following the rules in this document 158 ("NXDOMAIN cut"), a resolver would cache the first NXDOMAIN response, 159 as a sign of non-existence, and then immediately return an NXDOMAIN 160 response for the second query, without transmitting it to an 161 authoritative server. 163 If the first request is for 'bar.foo.example' and the second for 164 'baz.foo.example', the first NXDOMAIN response won't tell anything 165 about 'baz.foo.example' and therefore the second query will be 166 transmitted as it was before the use of "NXDOMAIN cut" optimisation 167 (see Appendix A). 169 These rules replace the second paragraph of section 5 of [RFC2308]. 170 Otherwise, this document does not update any other parts of 171 [RFC2308]. The fact that a subtree does not exist is not forever: 172 [RFC2308], section 3, already describes the amount of time that an 173 NXDOMAIN response may be cached (the "negative TTL"). 175 If the NXDOMAIN response due to a cached non-existence is from a 176 DNSSEC signed zone, then it will have accompanying NSEC or NSEC3 177 records that authenticate the non-existence of the name. For a 178 descendant name of the original NXDOMAIN name, the same set of NSEC 179 or NSEC3 records proves the non-existence of the descendant name. 180 The iterative, caching resolver MUST return these NSEC or NSEC3 181 records in the response to the triggering query if the query had the 182 DNSSEC OK (DO) bit set. 184 Warning: if there is a chain of CNAME (or DNAME), the name which does 185 not exist is the last of the chain ([RFC6604]) and not the QNAME. 186 The NXDOMAIN stored in the cache is for the denied name, not always 187 for the QNAME. 189 3. Benefits 191 The main benefit is a better efficiency of the caches. In the 192 example above, the resolver sends only one query instead of two, the 193 second one being answered from the cache. This will benefit the 194 entire DNS ecosystem, since the authoritative name servers will have 195 less unnecessary traffic to process. 197 The correct behavior (in [RFC1034] and made clearer in this document) 198 is specially useful when combined with QNAME minimisation [RFC7816] 199 since it will allow a resolver to stop searching as soon as an 200 NXDOMAIN is encountered. 202 "NXDOMAIN cut" may also help mitigate certain types of random QNAME 203 attacks [joost-dnsterror] [balakrichenan-dafa888], where there is a 204 fixed suffix which does not exist. In these attacks against the 205 authoritative name server, queries are sent to resolvers for a QNAME 206 composed of a fixed suffix ("dafa888.wf" in one of the articles 207 above), which is typically nonexistent, and a random prefix, 208 different for each request. A resolver receiving these requests have 209 to forward them to the authoritative servers. With "NXDOMAIN cut", a 210 system administrator would just have to send to the resolver a query 211 for the fixed suffix, the resolver would get a NXDOMAIN and then 212 would stop forwarding the queries. (It would be better if the SOA 213 record in the NXDOMAIN response were sufficient to find the non- 214 existing domain but it is not the case, see Appendix A.) 216 4. Possible issues 218 Let's assume the TLD example exists but foobar.example is not 219 delegated (so the example's name servers will reply NXDOMAIN for a 220 query about anything.foobar.example). A system administrator decides 221 to name the internal machines of his organization under 222 office.foobar.example and uses a trick of his resolver to forward 223 requests about this zone to his local authoritative name servers. 224 "NXDOMAIN cut" would create problems here, since, depending on the 225 order of requests to the resolver, it may have cached the non- 226 existence from example and therefore "deleted" everything under. 227 This document assumes that such setup is rare and does not need to be 228 supported. 230 Another issue that may happen: today, we see broken authoritative 231 name servers which reply to ENT ([RFC7719], section 6) with NXDOMAIN 232 instead of the normal NODATA ([RFC7719], section 3). 234 RFC-EDITOR: REMOVE THE PARAGRAPH BEFORE PUBLICATION. An example 235 today is mta2._domainkey.cbs.nl (which exists) where querying 236 _domainkey.cbs.nl yields NXDOMAIN. Another example is www.upenn.edu, 237 redirected to www.upenn.edu-dscg.edgesuite.net while a query for edu- 238 dscg.edgesuite.net returns NXDOMAIN. 240 Such name servers are definitely wrong and have always been. Their 241 behaviour is incompatible with DNSSEC. Given the advantages of 242 "NXDOMAIN cut", there is little reason to support this behavior. 244 5. Implementation considerations 246 This section is non-normative, and is composed only of various things 247 which may be useful for implementors. A recursive resolver may 248 implement its cache in many ways. The most obvious one is a tree 249 data structure, because it fits the data model of domain names. But, 250 in practice, other implementations are possible, as well as various 251 optimisations (such as a tree, augmented by an index of some common 252 domain names). 254 If a resolver implements its cache as a tree (without any 255 optimisation), one way to follow the rules of Section 2 is, when 256 receiving the NXDOMAIN, to prune the subtree of positive cache 257 entries at that node, or to delete all individual cache entries for 258 names below that node. Then, when searching downward in its cache, 259 this iterative caching DNS resolver stop searching if it encounters a 260 cached non-existence. 262 Some resolver may have a cache which is NOT organized as a tree (but, 263 for instance, as a dictionary) and therefore have a reason to ignore 264 the rules of Section 2. So these rules are a SHOULD and not a MUST. 266 6. IANA Considerations 268 This document has no actions for IANA. 270 7. Security Considerations 272 The technique described here may help against a denial-of-service 273 attack named "random qnames" and described in Section 3. 275 If a resolver does not validate the answers with DNSSEC, or if the 276 zone is not signed, the resolver can of course be poisoned with a 277 false NXDOMAIN, thus "deleting" a part of the domain name tree. This 278 denial-of-service attack is already possible without the rules of 279 this document (but "NXDOMAIN cut" may increase its effects). The 280 only solution is to use DNSSEC. 282 8. Implementation status - RFC EDITOR: REMOVE BEFORE PUBLICATION 284 This section records the status of known implementations of the 285 protocol defined by this specification at the time of posting of this 286 Internet-Draft, and is based on a proposal described in [RFC6982]. 287 The description of implementations in this section is intended to 288 assist the IETF in its decision processes in progressing drafts to 289 RFCs. Please note that the listing of any individual implementation 290 here does not imply endorsement by the IETF. Furthermore, no effort 291 has been spent to verify the information presented here that was 292 supplied by IETF contributors. This is not intended as, and must not 293 be construed to be, a catalog of available implementations or their 294 features. Readers are advised to note that other implementations may 295 exist. 297 According to [RFC6982], "this will allow reviewers and working groups 298 to assign due consideration to documents that have the benefit of 299 running code, which may serve as evidence of valuable experimentation 300 and feedback that have made the implemented protocols more mature. 301 It is up to the individual working groups to use this information as 302 they see fit". 304 As of today, practically all existing DNS resolvers are conservative 305 by default: they consider a NXDOMAIN as only significant for the 306 denied name itself, not for the names under. Almost all the current 307 recursive servers will send upstream a query for out-of-cache 308 sub.example.com even if their cache contains an NXDOMAIN for 309 example.com. 311 There are a few exceptions. The Unbound resolver has a configuration 312 parameter called "harden-below-nxdomain" [2], which if set to "yes" 313 turns on "NXDOMAIN cut" behavior ("only DNSSEC-secure nxdomains are 314 used", see Section 7). The PowerDNS recursor has optional partial 315 support for "NXDOMAIN cut", for the root domain only, with its "root- 316 nx-trust" setting, described as [3] "If set, an NXDOMAIN from the 317 root-servers will serve as a blanket NXDOMAIN for the entire TLD the 318 query belonged to. The effect of this is far fewer queries to the 319 root-servers.". 321 9. Acknowledgments 323 The main idea is in this document is taken from 324 [I-D.vixie-dnsext-resimprove], section 3, "Stopping Downward Cache 325 Search on NXDOMAIN". Thanks to its authors, Paul Vixie, Rodney 326 Joffe, and Frederico Neves. Additionally Tony Finch, John Levine, 327 Jinmei Tatuya, Bob Harold and Duane Wessels provided valuable 328 feedback and suggestions. 330 10. References 332 10.1. Normative References 334 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 335 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 336 . 338 [RFC1035] Mockapetris, P., "Domain names - implementation and 339 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 340 November 1987, . 342 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 343 Requirement Levels", BCP 14, RFC 2119, 344 DOI 10.17487/RFC2119, March 1997, 345 . 347 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 348 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 349 . 351 [RFC6604] Eastlake 3rd, D., "xNAME RCODE and Status Bits 352 Clarification", RFC 6604, DOI 10.17487/RFC6604, April 353 2012, . 355 10.2. Informative References 357 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 358 Rose, "Protocol Modifications for the DNS Security 359 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 360 . 362 [RFC6982] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 363 Code: The Implementation Status Section", RFC 6982, 364 DOI 10.17487/RFC6982, July 2013, 365 . 367 [RFC7719] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 368 Terminology", RFC 7719, DOI 10.17487/RFC7719, December 369 2015, . 371 [RFC7816] Bortzmeyer, S., "DNS Query Name Minimisation to Improve 372 Privacy", RFC 7816, DOI 10.17487/RFC7816, March 2016, 373 . 375 [I-D.vixie-dnsext-resimprove] 376 Vixie, P., Joffe, R., and F. Neves, "Improvements to DNS 377 Resolvers for Resiliency, Robustness, and Responsiveness", 378 draft-vixie-dnsext-resimprove-00 (work in progress), June 379 2010. 381 [I-D.fujiwara-dnsop-nsec-aggressiveuse] 382 Fujiwara, K. and A. Kato, "Aggressive use of NSEC/NSEC3", 383 draft-fujiwara-dnsop-nsec-aggressiveuse-03 (work in 384 progress), March 2016. 386 [joost-dnsterror] 387 Joost, M., "About DNS Attacks and ICMP Destination 388 Unreachable Reports", December 2014, 389 . 391 [balakrichenan-dafa888] 392 Balakrichenan, S., "Disturbance in the DNS - "Random 393 qnames", the dafa888 DoS attack"", October 2014, 394 . 397 10.3. URIs 399 [1] https://github.com/bortzmeyer/ietf-dnsop-nxdomain 401 [2] https://www.unbound.net/documentation/unbound.conf.html 403 [3] https://doc.powerdns.com/md/recursor/settings/#root-nx-trust 405 Appendix A. Why can't we just use the owner name of the returned SOA? 407 In this document, we deduce the non-existence of a domain only for 408 NXDOMAIN answers where the denied name was this exact domain. If a 409 resolver sends a query to the name servers of the TLD example, and 410 asks the MX record for www.foobar.example, and receives a NXDOMAIN, 411 it can only register the fact that www.foobar.example (and everything 412 underneath) does not exist. Even if the accompanying SOA record is 413 for example only, one cannot infer that foobar.example is 414 nonexistent. The accompanying SOA indicates the apex of the zone, 415 not the closest existing domain name. 417 RFC-EDITOR: REMOVE BEFORE PUBLICATION: to use a real example today, 418 ask the authoritative name servers of the TLD fr about 419 anything.which.does.not.exist.gouv.fr. The SOA will indicate fr (the 420 apex) even while gouv.fr does exist (there is no zone cut between 421 gouv.fr and fr). 423 Deducing the non-existence of a node from the SOA in the NXDOMAIN 424 reply may certainly help with random qnames attacks but this is out- 425 of-scope for this document. It would require to address the problems 426 mentioned in the first paragraph of this section. A possible 427 solution would be, when receiving a NXDOMAIN with a SOA which is more 428 than one label up in the tree, to send requests for the domains which 429 are between the QNAME and the owner name of the SOA. (A resolver 430 which does DNSSEC validation or QNAME minimisation will need to do 431 it, anyway.) 433 Appendix B. Related approaches 435 The document [I-D.fujiwara-dnsop-nsec-aggressiveuse] describes 436 another way to address some of the same concerns (decreasing the 437 traffic for non-existing domain names). Unlike "NXDOMAIN cut", it 438 requires DNSSEC but it is more powerful since it can synthesize 439 NXDOMAINs for domains that were not queried. 441 Authors' Addresses 443 Stephane Bortzmeyer 444 AFNIC 445 1, rue Stephenson 446 Montigny-le-Bretonneux 78180 447 France 449 Phone: +33 1 39 30 83 46 450 Email: bortzmeyer+ietf@nic.fr 451 URI: http://www.afnic.fr/ 453 Shumon Huque 454 Verisign Labs 455 12061 Bluemont Way 456 Reston 20190 457 USA 459 Email: shuque@verisign.com 460 URI: http://www.verisignlabs.com/