idnits 2.17.1 draft-ietf-dnsop-no-response-issue-09.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1057 has weird spacing: '...r zones for ...' -- The document date (July 18, 2018) is 2102 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Obsolete informational reference (is this intentional?): RFC 2671 (Obsoleted by RFC 6891) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Andrews 3 Internet-Draft ISC 4 Intended status: Best Current Practice July 18, 2018 5 Expires: January 19, 2019 7 A Common Operational Problem in DNS Servers - Failure To Respond. 8 draft-ietf-dnsop-no-response-issue-09 10 Abstract 12 The DNS is a query / response protocol. Failing to respond to 13 queries, or responding incorrectly, causes both immediate operational 14 problems and long term problems with protocol development. 16 This document identifies a number of common kinds of queries to which 17 some servers either fail to respond or else respond incorrectly. 18 This document also suggests procedures for TLD and other zone 19 operators to apply to help reduce / eliminate the problem. 21 The document does not look at the DNS data itself, just the structure 22 of the responses. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on January 19, 2019. 41 Copyright Notice 43 Copyright (c) 2018 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. Consequences . . . . . . . . . . . . . . . . . . . . . . . . 4 60 3. Common queries kinds that result in non responses. . . . . . 5 61 3.1. Basic DNS Queries . . . . . . . . . . . . . . . . . . . . 5 62 3.1.1. Zone Existence . . . . . . . . . . . . . . . . . . . 5 63 3.1.2. Unknown / Unsupported Type Queries . . . . . . . . . 5 64 3.1.3. DNS Flags . . . . . . . . . . . . . . . . . . . . . . 6 65 3.1.4. Unknown DNS opcodes . . . . . . . . . . . . . . . . . 6 66 3.1.5. Recursive Queries . . . . . . . . . . . . . . . . . . 6 67 3.1.6. TCP Queries . . . . . . . . . . . . . . . . . . . . . 6 68 3.2. EDNS Queries . . . . . . . . . . . . . . . . . . . . . . 6 69 3.2.1. EDNS Queries - Version Independent . . . . . . . . . 7 70 3.2.2. EDNS Queries - Version Specific . . . . . . . . . . . 7 71 3.2.3. EDNS Options . . . . . . . . . . . . . . . . . . . . 7 72 3.2.4. EDNS Flags . . . . . . . . . . . . . . . . . . . . . 7 73 3.2.5. Truncated EDNS Responses . . . . . . . . . . . . . . 8 74 3.2.6. DO Bit Handling . . . . . . . . . . . . . . . . . . . 8 75 3.2.7. EDNS over TCP . . . . . . . . . . . . . . . . . . . . 8 76 4. Firewalls and Load Balancers . . . . . . . . . . . . . . . . 8 77 5. Scrubbing Services . . . . . . . . . . . . . . . . . . . . . 9 78 6. Whole Answer Caches . . . . . . . . . . . . . . . . . . . . . 10 79 7. Response Code Selection . . . . . . . . . . . . . . . . . . . 10 80 8. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 81 8.1. Testing - Basic DNS . . . . . . . . . . . . . . . . . . . 11 82 8.1.1. Is The Server Configured For The Zone? . . . . . . . 11 83 8.1.2. Testing Unknown Types . . . . . . . . . . . . . . . . 12 84 8.1.3. Testing Header Bits . . . . . . . . . . . . . . . . . 12 85 8.1.4. Testing Unknown Opcodes . . . . . . . . . . . . . . . 14 86 8.1.5. Testing Recursive Queries . . . . . . . . . . . . . . 15 87 8.1.6. Testing TCP . . . . . . . . . . . . . . . . . . . . . 15 88 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 16 89 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 16 90 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 16 91 8.2.3. Testing Unknown EDNS Options . . . . . . . . . . . . 17 92 8.2.4. Testing Unknown EDNS Flags . . . . . . . . . . . . . 18 93 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS 94 Flags . . . . . . . . . . . . . . . . . . . . . . . . 18 95 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS 96 Options . . . . . . . . . . . . . . . . . . . . . . . 19 98 8.2.7. Testing Truncated Responses . . . . . . . . . . . . . 20 99 8.2.8. Testing DNSSEC Queries . . . . . . . . . . . . . . . 20 100 8.2.9. Testing EDNS Version Negotiation With DNSSEC . . . . 21 101 8.2.10. Testing With Multiple Defined EDNS Options . . . . . 22 102 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 22 103 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 22 104 10. Security Considerations . . . . . . . . . . . . . . . . . . . 24 105 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 106 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 107 12.1. Normative References . . . . . . . . . . . . . . . . . . 24 108 12.2. Informative References . . . . . . . . . . . . . . . . . 25 109 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 25 111 1. Introduction 113 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failing 114 to respond to queries, or responding incorrectly, causes both 115 immediate operational problems and long term problems with protocol 116 development. 118 Failure to respond to a query is indistinguishable from packet loss 119 without doing an analysis of query-response patterns. Additionally 120 failure to respond results in unnecessary queries being made by DNS 121 clients, and introduces delays to the resolution process. 123 Due to the inability to distinguish between packet loss and 124 nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes 125 misclassified as lack of EDNS support which can lead to DNSSEC 126 validation failures. 128 The existance of servers which fail to respond to queries results in 129 developers being hesitant to deploy new standards. Such servers need 130 to be identified and remediated. 132 The DNS has response codes that cover almost any conceivable query 133 response. A nameserver should be able to respond to any conceivable 134 query using them. There should be no need to drop queries because a 135 nameserver does not understand them. 137 Unless a nameserver is under attack, it should respond to all queries 138 directed to it. When a nameserver is under attack it may wish to 139 drop packets. A common attack is to use a nameserver as a amplifier 140 by sending spoofed packets. This is done because response packets 141 are bigger than the queries and big amplification factors are 142 available especially if EDNS is supported. Limiting the rate of 143 responses is reasonable when this is occurring and the client should 144 retry. This however only works if legitimate clients are not being 145 forced to guess whether EDNS queries are accepted or not. While 146 there is still a pool of servers that don't respond to EDNS requests, 147 clients have no way to know if the lack of response is due to packet 148 loss, EDNS packets not being supported, or rate limiting due to the 149 server being under attack. Misclassification of server behaviour is 150 unavoidable when rate limiting is used until the population of 151 servers which fail to respond to well formed queries drops to near 152 zero. 154 A nameserver should not assume that there isn't a delegation to the 155 server even if it is not configured to serve the zone. Misconfigured 156 nameservers are a common occurrence in the DNS and receiving queries 157 for zones that the server is not configured for is not necessarily an 158 indication that the server is under attack. Parent zone operators 159 are advised to regularly check that the delegating NS records are 160 consistent with those of the delegated zone and to correct them when 161 they are not [RFC1034]. Doing this regularly should reduce the 162 instances of broken delegations. 164 2. Consequences 166 Failure to follow the relevant DNS RFCs has multiple adverse 167 consequences. Some are caused directly from the non-compliant 168 behaviour and others as a result of work-arounds forced on recursive 169 servers. Addressing known issues now will reduce future 170 interoperability issues as the DNS protocol continues to evolve and 171 clients make use of newly-introduced DNS features. 173 Some examples of known consequences include: 175 o The AD flag bit in a response cannot be trusted to mean anything 176 as some servers incorrectly copy the flag bit from the request to 177 the response [RFC1035], [RFC4035]. 179 o Widespread non-response to EDNS queries has lead to recursive 180 servers having to assume that EDNS is not supported and that 181 fallback to plain DNS is required, potentially causing DNSSEC 182 validation failures. 184 o Widespread non-response to EDNS options, requires recursive 185 servers to have to decide whether to probe to see if it is the 186 EDNS option or just EDNS that is causing the non response. In the 187 limited amount of time required to resolve a query before the 188 client times out this is not possible. 190 o Incorrectly returning FORMERR to a EDNS option being present, 191 leads to the recursive server not being able to determine if the 192 server is just broken in the handling of the EDNS option or 193 doesn't support EDNS at all. 195 o Mishandling of unknown query types has contributed to the 196 abandoning of the transition of the SPF type. 198 o Mishandling of unknown query types has slowed up the development 199 of DANE and resulted in additional rules being specified to reduce 200 the probability of interacting with a broken server when making 201 TLSA queries. 203 The consequences of servers not following the RFCs will only grow if 204 measures are not put in place to remove non compliant servers from 205 the ecosystem. Working around issues due to non-compliance with RFCs 206 is not sustainable. 208 Most (if not all) of these consequences could have been avoided if 209 action had been taken to remove non-compliant servers as soon as 210 people were aware of them, i.e. to actively seek out broken 211 implementations and servers and inform their developers and operators 212 that they need to fix their servers. 214 3. Common queries kinds that result in non responses. 216 There are a number common query kinds that fail to respond today. 217 They are: EDNS queries with and without extensions; queries for 218 unknown (unallocated) or unsupported types; and filtering of TCP 219 queries. 221 3.1. Basic DNS Queries 223 3.1.1. Zone Existence 225 Initially, to test existence of the zone, an SOA query should be 226 made. If the SOA record is not returned but some other response is 227 returned, this is a indication of a bad delegation. If the tester 228 fails to get a response to a SOA query, the Operator should make an A 229 query for the zone, as some nameservers fail to respond to SOA 230 queries but will respond to A queries. 232 3.1.2. Unknown / Unsupported Type Queries 234 Identifying servers that fail to respond to unknown or unsupported 235 types can be done by making an initial DNS query for an A record, 236 making a number of queries for an unallocated type, then making a 237 query for an A record again. IANA maintains a registry of allocated 238 types. 240 If the server responds to the first and last queries but fails to 241 respond to the queries for the unallocated type, it is probably 242 faulty. The test should be repeated a number of times to eliminate 243 the likelihood of a false positive due to packet loss. 245 3.1.3. DNS Flags 247 Some servers fail to respond to DNS queries with various DNS flags 248 set, regardless of whether they are defined or still reserved. At 249 the time of writing there are servers that fail to respond to queries 250 with the AD bit set to 1 and servers that fail to respond to queries 251 with the last reserved flag bit set. 253 3.1.4. Unknown DNS opcodes 255 The use of previously undefined opcodes is to be expected. Since the 256 DNS was first defined two new opcodes have been added, UPDATE and 257 NOTIFY. 259 NOTIMP is the expected rcode to an unknown or unimplemented opcode. 261 Note: while new opcodes will most probably use the current layout 262 structure for the rest of the message there is no requirement that 263 anything other than the DNS header match. 265 3.1.5. Recursive Queries 267 A non-recursive server is supposed to respond to recursive queries as 268 if the RD bit is not set [RFC1034]. 270 3.1.6. TCP Queries 272 All DNS servers are supposed to respond to queries over TCP 273 [RFC7766]. While firewalls should not block TCP connection attempts 274 if they do they should cleanly terminate the connection by sending 275 TCP RESET or sending ICMP/ICMPv6 Administratively Prohibited 276 messages. Dropping TCP connections introduces excessive delays to 277 the resolution process. 279 Whether a server accepts TCP connections can be tested by first 280 checking that it responds to UDP queries to confirm that it is up and 281 operating, then attempting the same query over TCP. An additional 282 query should be made over UDP if the TCP connection attempt fails to 283 confirm that the server under test is still operating. 285 3.2. EDNS Queries 287 EDNS queries are specified in [RFC6891]. 289 3.2.1. EDNS Queries - Version Independent 291 Identifying servers that fail to respond to EDNS queries can be done 292 by first confirming that the server responds to regular DNS queries, 293 followed by a series of otherwise identical queries using EDNS, then 294 making the original query again. A series of EDNS queries is needed 295 as at least one DNS implementation responds to the first EDNS query 296 with FORMERR but fails to respond to subsequent queries from the same 297 address for a period until a regular DNS query is made. The EDNS 298 query should specify a UDP buffer size of 512 bytes to avoid false 299 classification of not supporting EDNS due to response packet size. 301 If the server responds to the first and last queries but fails to 302 respond to most or all of the EDNS queries, it is probably faulty. 303 The test should be repeated a number of times to eliminate the 304 likelihood of a false positive due to packet loss. 306 Firewalls may also block larger EDNS responses but there is no easy 307 way to check authoritative servers to see if the firewall is mis- 308 configured. 310 3.2.2. EDNS Queries - Version Specific 312 Some servers respond correctly to EDNS version 0 queries but fail to 313 respond to EDNS queries with version numbers that are higher than 314 zero. Servers should respond with BADVERS to EDNS queries with 315 version numbers that they do not support. 317 Some servers respond correctly to EDNS version 0 queries but fail to 318 set QR=1 when responding to EDNS versions they do not support. Such 319 answers are discarded or treated as requests. 321 3.2.3. EDNS Options 323 Some servers fail to respond to EDNS queries with EDNS options set. 324 Unknown EDNS options are supposed to be ignored by the server 325 [RFC6891], the original EDNS specifion left this behaviour undefined 326 [RFC2671]. 328 3.2.4. EDNS Flags 330 Some servers fail to respond to EDNS queries with EDNS flags set. 331 Server should ignore EDNS flags they do not understand and should not 332 add them to the response [RFC6891]. 334 3.2.5. Truncated EDNS Responses 336 Some EDNS aware servers fail to include an OPT record when a 337 truncated response is sent. An OPT record is supposed to be included 338 in a truncated response [RFC6891]. 340 Some EDNS aware server fail to honour the advertised EDNS buffer size 341 and send over-sized responses. 343 3.2.6. DO Bit Handling 345 Some nameservers incorrectly only return a EDNS response when the DO 346 bit is present in the query. Additionally some nameservers fail to 347 copy the DO bit to the response despite clearly supporting DNSSEC by 348 returning RRSIG records to EDNS queries with the DO bit set. 350 3.2.7. EDNS over TCP 352 Some EDNS aware servers incorrectly limit the TCP response sizes to 353 the advertised UDP response size. 355 4. Firewalls and Load Balancers 357 Firewalls and load balancers can affect the externally visible 358 behaviour of a nameserver. Tests for conformance should to be done 359 from outside of any firewall so that the system is tested as a whole. 361 Firewalls and load balancers should not drop DNS packets that they 362 don't understand. They should either pass the packets or generate an 363 appropriate error response. 365 Requests for unknown query types are normal client behaviour and 366 should not be construed as an attack. Nameservers have always been 367 expected to be able to handle such queries. 369 Requests for unknown query classes are normal client behaviour and 370 should not be construed as an attack. Nameservers have always been 371 expected to be able to handle such queries. 373 Requests with unknown opcodes are normal client behaviour and should 374 not be construed as an attack. Nameservers have always been expected 375 to be able to handle such queries. 377 Requests with unassigned flags set (DNS or EDNS) are expected client 378 behaviour and should not be construed as an attack. The behaviour 379 for unassigned flags is to ignore them in the request and to not set 380 them in the response. Dropping DNS / EDNS packets with unassigned 381 flags makes it difficult to deploy extensions that make use of them 382 due to the need to reconfigure and update firewalls. 384 Requests with unknown EDNS options are expected client behaviour and 385 should not be construed as an attack. The correct behaviour for 386 unknown EDNS options is to ignore their presence when constructing a 387 reply. 389 Requests with unknown EDNS versions are expected client behaviour and 390 should not be construed as an attack. The correct behaviour for 391 unknown EDNS versions is to return BADVERS along with the highest 392 EDNS version the server supports. Dropping EDNS packets breaks EDNS 393 version negotiation. 395 Firewalls should not assume that there will only be a single response 396 message to a request. There have been proposals to use EDNS to 397 signal that multiple DNS messages be returned rather than a single 398 UDP message that is fragmented at the IP layer. 400 DNS, and EDNS in particular, are designed to allow clients to be able 401 to use new features against older servers without having to validate 402 every option. Indiscriminate blocking of messages breaks that 403 design. 405 However, there may be times when a nameserver mishandles messages 406 with a particular flag, EDNS option, EDNS version field, opcode, type 407 or class field or combination thereof to the point where the 408 integrity of the nameserver is compromised. Firewalls should offer 409 the ability to selectively reject messages using an appropriately 410 constructed response based on all these fields while awaiting a fix 411 from the nameserver vendor. 413 5. Scrubbing Services 415 Scrubbing services can affect the externally visible behaviour of a 416 nameserver in a similar way to firewalls. If a operator uses a 417 scrubbing service, they should check that legitimate queries are not 418 being blocked. 420 Scrubbing services, unlike firewalls, are also turned on and off in 421 response to denial of service attacks. One needs to take care when 422 choosing a scrubbing service. 424 Ideally, Operators should run these tests against a scrubbing service 425 to ensure that these tests are not seen as attack vectors. 427 6. Whole Answer Caches 429 Whole answer caches take a previously constructed answer and return 430 it to a subsequent query for the same qname, qtype and qclass, just 431 updating the query id field and possibly the qname to match the 432 incoming query to avoid constructing each response individually. 434 Whole answer caches can return the wrong response to a query if they 435 do not take all of the attributes of the query into account, rather 436 than just some of them e.g. qname, qtype and qclass. This has 437 implications when testing and with overall protocol compliance. 439 Two current examples are: 441 o Whole answer caches that ignore the EDNS version field which 442 results in incorrect answers to non EDNS version 0 queries being 443 returned if they were preceded by a EDNS version 0 query for the 444 same name and type. 446 o Whole answer caches that ignore the EDNS options in the query 447 resulting in options only working some of the time and/or options 448 being returned when not requested. 450 7. Response Code Selection 452 Choosing the correct response code when responding to DNS queries is 453 important. Just because a DNS qtype is not implemented does not mean 454 that NOTIMP is the correct response code to return. Response codes 455 should be chosen considering how clients will handle them. 457 For unimplemented opcodes NOTIMP is the expected response code. For 458 example, a new opcode could change the message format by extending 459 the header or changing the structure of the records etc. This may 460 result in FORMERR being returned though NOTIMP would be more correct. 462 Unimplemented type codes, Name Error (NXDOMAIN) and NOERROR (no data) 463 are the expected response codes. A server is not supposed to serve a 464 zone which contains unsupported types ([RFC1034]) so the only thing 465 left is return if the QNAME exists or not. NOTIMP and REFUSED are 466 not useful responses as they force the clients to try the other 467 authoritative servers for a zone looking for a server which will 468 answer the query. 470 Meta queries may be the exception but these need to be thought about 471 on a case by case basis. 473 If the server supports EDNS and receives a query with an unsupported 474 EDNS version, the correct response is BADVERS [RFC6891]. 476 If the server does not support EDNS at all, FORMERR and NOTIMP are 477 the expected error codes. That said a minimal EDNS server 478 implementation requires parsing the OPT records and responding with 479 an empty OPT record. There is no need to interpret any EDNS options 480 present in the request as unsupported EDNS options are expected to be 481 ignored [RFC6891]. 483 8. Testing 485 Testing is divided into two sections. Basic DNS which all servers 486 should meet and Extended DNS which should be met by all servers that 487 support EDNS (a server is deemed to support EDNS if it gives a valid 488 EDNS response to any EDNS query). If a server does not support EDNS 489 it should still respond to all the tests. 491 It is advisable to run all of the tests below in parallel so as to 492 minimise the delays due to multiple timeouts when the servers do not 493 respond. There are 16 queries directed to each nameserver assuming 494 no packet loss testing different aspects of Basic DNS and EDNS. 496 The tests below use dig from BIND 9.11.0. 498 8.1. Testing - Basic DNS 500 This first set of tests cover basic DNS server behaviour and all 501 servers should pass these tests. 503 8.1.1. Is The Server Configured For The Zone? 505 Ask for the SOA record of the zone the server is nominally configured 506 to serve. This query is made with no DNS flag bits set and without 507 EDNS. 509 We expect the SOA record for the zone to be returned in the answer 510 section with the rcode set to NOERROR and the AA and QR bits to be 511 set in the response, RA may also be set [RFC1034]. We do not expect 512 a OPT record to be returned [RFC6891]. 514 Verify the server is configured for the zone: 516 dig +noedns +noad +norec soa $zone @$server 518 expect: status: NOERROR 519 expect: the SOA record to be present in the answer section 520 expect: flag: aa to be present 521 expect: flag: rd to NOT be present 522 expect: flag: ad to NOT be present 523 expect: the OPT record to NOT be present 525 8.1.2. Testing Unknown Types 527 Ask for the TYPE1000 record at the zone's name. This query is made 528 with no DNS flag bits set and without EDNS. TYPE1000 has been chosen 529 for this purpose as IANA is unlikely to allocate this type in the 530 near future and it is not in type space reserved for end user 531 allocation. 533 We don't expect any records to be returned in the answer section with 534 the rcode set to NOERROR and the AA and QR bits to be set in the 535 response, RA may also be set [RFC1034]. We do not expect a OPT 536 record to be returned [RFC6891]. 538 Check that queries for an unknown type work: 540 dig +noedns +noad +norec type1000 $zone @$server 542 expect: status: NOERROR 543 expect: an empty answer section. 544 expect: flag: aa to be present 545 expect: flag: rd to NOT be present 546 expect: flag: ad to NOT be present 547 expect: the OPT record to NOT be present 549 That new types are to be expected is specified in Section 3.6, 550 [RFC1035]. Servers that don't support a new type are expected to 551 reject a zone that contains a unsupported type as per Section 5.2, 552 [RFC1035]. This means that a server that does load a zone can answer 553 questions for unknown types with NOERROR or NXDOMAIN as per 554 Section 4.3.2, [RFC1034]. [RFC6895] later reserved distinct ranges 555 for meta and data types which allows servers to be definitive about 556 whether a query should be answerable from zone content or not. 558 8.1.3. Testing Header Bits 560 8.1.3.1. Testing CD=1 Queries 562 Ask for the SOA record of the zone the server is nominally configured 563 to serve. This query is made with only the CD DNS flag bit set and 564 all other DNS bits clear and without EDNS. 566 We expect the SOA record for the zone to be returned in the answer 567 section with the rcode set to NOERROR and the AA and QR bits to be 568 set in the response. We do not expect a OPT record to be returned. 570 If the server supports DNSSEC, CD should be set in the response 571 [RFC4035] otherwise CD should be clear [RFC1034]. 573 Check that queries with CD=1 work: 575 dig +noedns +noad +norec +cd soa $zone @$server 577 expect: status: NOERROR 578 expect: the SOA record to be present in the answer section 579 expect: flag: aa to be present 580 expect: flag: rd to NOT be present 581 expect: flag: ad to NOT be present 582 expect: the OPT record to NOT be present 584 CD use in queries is defined in [RFC4035]. 586 8.1.3.2. Testing AD=1 Queries 588 Ask for the SOA record of the zone the server is nominally configured 589 to serve. This query is made with only the AD DNS flag bit set and 590 all other DNS bits clear and without EDNS. 592 We expect the SOA record for the zone to be returned in the answer 593 section with the rcode set to NOERROR and the AA and QR bits to be 594 set in the response. We do not expect a OPT record to be returned. 596 If the server supports DNSSEC, AD may be set in the response 597 [RFC6840] otherwise AD should be clear [RFC1034]. 599 Check that queries with AD=1 work: 601 dig +noedns +norec +ad soa $zone @$server 603 expect: status: NOERROR 604 expect: the SOA record to be present in the answer section 605 expect: flag: aa to be present 606 expect: flag: rd to NOT be present 607 expect: the OPT record to NOT be present 609 AD use in queries is defined in [RFC6840]. 611 8.1.3.3. Testing Reserved Bit 613 Ask for the SOA record of the zone the server is nominally configured 614 to serve. This query is made with only the final reserved DNS flag 615 bit set and all other DNS bits clear and without EDNS. 617 We expect the SOA record for the zone to be returned in the answer 618 section with the rcode set to NOERROR and the AA and QR bits to be 619 set in the response, RA may be set. The final reserved bit must not 620 be set [RFC1034]. We do not expect a OPT record to be returned 621 [RFC6891]. 623 Check that queries with the last unassigned DNS header flag work and 624 that the flag bit is not copied to the response: 626 dig +noedns +noad +norec +zflag soa $zone @$server 628 expect: status: NOERROR 629 expect: the SOA record to be present in the answer section 630 expect: MBZ to NOT be in the response 631 expect: flag: aa to be present 632 expect: flag: rd to NOT be present 633 expect: flag: ad to NOT be present 634 expect: the OPT record to NOT be present 636 MBZ (Must Be Zero) presence indicates the flag bit has been 637 incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved for 638 future use. Must be zero in all queries and responses." 640 8.1.4. Testing Unknown Opcodes 642 Construct a DNS message that consists of only a DNS header with 643 opcode set to 15 (currently not allocated), no DNS header bits set 644 and empty question, answer, authority and additional sections. 646 Check that new opcodes are handled: 648 dig +noedns +noad +opcode=15 +norec +header-only @$server 650 expect: status: NOTIMP 651 expect: SOA record to NOT be present 652 expect: flag: aa to NOT be present 653 expect: flag: rd to NOT be present 654 expect: flag: ad to NOT be present 655 expect: the OPT record to NOT be present 657 As unknown opcodes have no definition, including packet format other 658 than there must be a DNS header present (QR, OPCODE and RCODE are the 659 only header fields that need to be common across all opcodes, 660 everything else in the header can potentially be redefined), there is 661 only one possible rcode that make sense to return to a request with a 662 unknown opcode and that is NOTIMP. 664 8.1.5. Testing Recursive Queries 666 Ask for the SOA record of the zone the server is nominally configured 667 to serve. This query is made with only the RD DNS flag bit set and 668 without EDNS. 670 We expect the SOA record for the zone to be returned in the answer 671 section with the rcode set to NOERROR and the AA, QR and RD bits to 672 be set in the response, RA may also be set [RFC1034]. We do not 673 expect a OPT record to be returned [RFC6891]. 675 Check that recursive queries work: 677 dig +noedns +noad +rec soa $zone @$server 679 expect: status: NOERROR 680 expect: the SOA record to be present in the answer section 681 expect: flag: aa to be present 682 expect: flag: rd to be present 683 expect: flag: ad to NOT be present 684 expect: the OPT record to NOT be present 686 8.1.6. Testing TCP 688 Ask for the SOA record of the zone the server is nominally configured 689 to serve. This query is made with no DNS flag bits set and without 690 EDNS. This query is to be sent using TCP. 692 We expect the SOA record for the zone to be returned in the answer 693 section with the rcode set to NOERROR and the AA and QR bits to be 694 set in the response, RA may also be set [RFC1034]. We do not expect 695 a OPT record to be returned [RFC6891]. 697 Check that TCP queries work: 699 dig +noedns +noad +norec +tcp soa $zone @$server 701 expect: status: NOERROR 702 expect: the SOA record to be present in the answer section 703 expect: flag: aa to be present 704 expect: flag: rd to NOT be present 705 expect: flag: ad to NOT be present 706 expect: the OPT record to NOT be present 708 The requirement that TCP be supported is defined in [RFC7766]. 710 8.2. Testing - Extended DNS 712 The next set of test cover various aspects of EDNS behaviour. If any 713 of these tests succeed, then all of them should succeed. There are 714 servers that support EDNS but fail to handle plain EDNS queries 715 correctly so a plain EDNS query is not a good indicator of lack of 716 EDNS support. 718 8.2.1. Testing Minimal EDNS 720 Ask for the SOA record of the zone the server is nominally configured 721 to serve. This query is made with no DNS flag bits set. EDNS 722 version 0 is used without any EDNS options or EDNS flags set. 724 We expect the SOA record for the zone to be returned in the answer 725 section with the rcode set to NOERROR and the AA and QR bits to be 726 set in the response, RA may also be set [RFC1034]. We expect a OPT 727 record to be returned. There should be no EDNS flags present in the 728 response. The EDNS version field should be zero and there should be 729 no EDNS options present [RFC6891]. 731 Check that plain EDNS queries work: 733 dig +nocookie +edns=0 +noad +norec soa $zone @$server 735 expect: status: NOERROR 736 expect: the SOA record to be present in the answer section 737 expect: a OPT record to be present in the additional section 738 expect: EDNS Version 0 in response 739 expect: flag: aa to be present 740 expect: flag: ad to NOT be present 742 +nocookie disables sending a EDNS COOKIE option in which is on by 743 default in BIND 9.11.0. 745 8.2.2. Testing EDNS Version Negotiation 747 Ask for the SOA record of the zone the server is nominally configured 748 to serve. This query is made with no DNS flag bits set. EDNS 749 version 1 is used without any EDNS options or EDNS flags set. 751 We expect the SOA record for the zone to NOT be returned in the 752 answer section with the extended rcode set to BADVERS and the QR bit 753 to be set in the response, RA may also be set [RFC1034]. We expect a 754 OPT record to be returned. There should be no EDNS flags present in 755 the response. The EDNS version field should be zero as EDNS versions 756 other than 0 are yet to be specified and there should be no EDNS 757 options present [RFC6891]. 759 Check that EDNS version 1 queries work (EDNS supported): 761 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 763 expect: status: BADVERS 764 expect: the SOA record to NOT be present in the answer section 765 expect: a OPT record to be present in the additional section 766 expect: EDNS Version 0 in response 767 expect: flag: aa to NOT be present 768 expect: flag: ad to NOT be present 770 Only EDNS Version 0 is currently defined so the response should 771 always be a 0 version. This will change when EDNS version 1 is 772 defined. BADVERS is the expected rcode if EDNS is supported as per 773 Section 6.1.3, [RFC6891]. 775 8.2.3. Testing Unknown EDNS Options 777 Ask for the SOA record of the zone the server is nominally configured 778 to serve. This query is made with no DNS flag bits set. EDNS 779 version 0 is used without any EDNS flags. A EDNS option is present 780 with a value from the yet to be assigned range. The unassigned value 781 chosen is 100 and will need to be adjusted when IANA assigns this 782 value formally. 784 We expect the SOA record for the zone to be returned in the answer 785 section with the rcode set to NOERROR and the AA and QR bits to be 786 set in the response, RA may also be set [RFC1034]. We expect a OPT 787 record to be returned. There should be no EDNS flags present in the 788 response. The EDNS version field should be zero as EDNS versions 789 other than 0 are yet to be specified and there should be no EDNS 790 options present as unknown EDNS options are supposed to be ignored by 791 the server [RFC6891]. 793 Check that EDNS queries with an unknown option work (EDNS supported): 795 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 797 expect: status: NOERROR 798 expect: the SOA record to be present in the answer section 799 expect: a OPT record to be present in the additional section 800 expect: OPT=100 to NOT be present 801 expect: EDNS Version 0 in response 802 expect: flag: aa to be present 803 expect: flag: ad to NOT be present 805 Unknown EDNS options are supposed to be ignored, Section 6.1.2, 806 [RFC6891]. 808 8.2.4. Testing Unknown EDNS Flags 810 Ask for the SOA record of the zone the server is nominally configured 811 to serve. This query is made with no DNS flag bits set. EDNS 812 version 0 is used without any EDNS options. A unassigned EDNS flag 813 bit is set (0x40 in this case). 815 We expect the SOA record for the zone to be returned in the answer 816 section with the rcode set to NOERROR and the AA and QR bits to be 817 set in the response, RA may also be set [RFC1034]. We expect a OPT 818 record to be returned. There should be no EDNS flags present in the 819 response as unknown EDNS flags are supposed to be ignored. The EDNS 820 version field should be zero and there should be no EDNS options 821 present [RFC6891]. 823 Check that EDNS queries with unknown flags work (EDNS supported): 825 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 827 expect: status: NOERROR 828 expect: the SOA record to be present in the answer section 829 expect: a OPT record to be present in the additional section 830 expect: MBZ not to be present 831 expect: EDNS Version 0 in response 832 expect: flag: aa to be present 833 expect: flag: ad to NOT be present 835 MBZ (Must Be Zero) presence indicates the flag bit has been 836 incorrectly copied as per Section 6.1.4, [RFC6891]. 838 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 840 Ask for the SOA record of the zone the server is nominally configured 841 to serve. This query is made with no DNS flag bits set. EDNS 842 version 1 is used without any EDNS options. A unassigned EDNS flag 843 bit is set (0x40 in this case). 845 We expect the SOA record for the zone to NOT be returned in the 846 answer section with the extended rcode set to BADVERS and the QR bit 847 to be set in the response, RA may also be set [RFC1034]. We expect a 848 OPT record to be returned. There should be no EDNS flags present in 849 the response as unknown EDNS flags are supposed to be ignored. The 850 EDNS version field should be zero as EDNS versions other than 0 are 851 yet to be specified and there should be no EDNS options present 852 [RFC6891]. 854 Check that EDNS version 1 queries with unknown flags work (EDNS 855 supported): 857 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 858 $zone @$server 860 expect: status: BADVERS 861 expect: SOA record to NOT be present 862 expect: a OPT record to be present in the additional section 863 expect: MBZ not to be present 864 expect: EDNS Version 0 in response 865 expect: flag: aa to NOT be present 866 expect: flag: ad to NOT be present 868 +noednsneg disables EDNS version negotiation in DiG; MBZ (Must Be 869 Zero) presence indicates the flag bit has been incorrectly copied. 871 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 873 Ask for the SOA record of the zone the server is nominally configured 874 to serve. This query is made with no DNS flag bits set. EDNS 875 version 1 is used. A unknown EDNS option is present (option code 100 876 has been chosen). 878 We expect the SOA record for the zone to NOT be returned in the 879 answer section with the extended rcode set to BADVERS and the QR bit 880 to be set in the response, RA may also be set [RFC1034]. We expect a 881 OPT record to be returned. There should be no EDNS flags present in 882 the response. The EDNS version field should be zero as EDNS versions 883 other than 0 are yet to be specified and there should be no EDNS 884 options present [RFC6891]. 886 Check that EDNS version 1 queries with unknown options work (EDNS 887 supported): 889 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 890 $zone @$server 892 expect: status: BADVERS 893 expect: SOA record to NOT be present 894 expect: a OPT record to be present in the additional section 895 expect: OPT=100 to NOT be present 896 expect: EDNS Version 0 in response 897 expect: flag: aa to be present 898 expect: flag: ad to NOT be present 900 +noednsneg disables EDNS version negotiation in DiG. 902 8.2.7. Testing Truncated Responses 904 Ask for the DNSKEY records of the zone the server is nominally 905 configured to serve. This query is made with no DNS flag bits set. 906 EDNS version 0 is used without any EDNS options. The only EDNS flag 907 set is DO. The EDNS UDP buffer size is set to 512. The intention of 908 this query is elicit a truncated response from the server. Most 909 signed DNSKEY responses are bigger than 512 bytes. 911 We expect a response with the rcode set to NOERROR and the AA and QR 912 bits to be set, AD may be set in the response if the server supports 913 DNSSEC otherwise it should be clear. TC and RA may also be set 914 [RFC1034]. We expect a OPT record to be present in the response. 915 There should be no EDNS flags other than DO present in the response. 916 The EDNS version field should be zero and there should be no EDNS 917 options present [RFC6891]. 919 If TC is not set it is not possible to confirm that the server 920 correctly adds the OPT record to the truncated responses or not. 922 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 923 expect: NOERROR 924 expect: OPT record with version set to 0 926 8.2.8. Testing DNSSEC Queries 928 Ask for the SOA record of the zone the server is nominally configured 929 to serve. This query is made with no DNS flag bits set. EDNS 930 version 0 is used without any EDNS options. The only EDNS flag set 931 is DO. 933 We expect the SOA record for the zone to be returned in the answer 934 section with the rcode set to NOERROR and the AA and QR bits to be 935 set in the response, AD may be set in the response if the server 936 supports DNSSEC otherwise it should be clear. RA may also be set 937 [RFC1034]. We expect a OPT record to be returned. There should be 938 no EDNS flags other than DO present in the response which should be 939 present if the server supports DNSSEC. The EDNS version field should 940 be zero and there should be no EDNS options present [RFC6891]. 942 Check that a DNSSEC queries work (EDNS supported): 944 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 946 expect: status: NOERROR 947 expect: the SOA record to be present in the answer section 948 expect: a OPT record to be present in the additional section 949 expect: DO=1 to be present if a RRSIG is in the response 950 expect: EDNS Version 0 in response 951 expect: flag: aa to be present 953 DO=1 should be present if RRSIGs are returned as they indicate that 954 the server supports DNSSEC. Servers that support DNSSEC are supposed 955 to copy the DO bit from the request to the response as per [RFC3225]. 957 8.2.9. Testing EDNS Version Negotiation With DNSSEC 959 Ask for the SOA record of the zone the server is nominally configured 960 to serve. This query is made with no DNS flag bits set. EDNS 961 version 1 is used without any EDNS options. The only EDNS flag set 962 is DO. 964 We expect the SOA record for the zone to NOT be returned in the 965 answer section with the rcode set to BADVERS and the only the QR bit 966 and possibly the RA bit to be set [RFC1034]. We expect a OPT record 967 to be returned. There should be no EDNS flags other than DO present 968 in the response which should be present if the server supports 969 DNSSEC. The EDNS version field should be zero and there should be no 970 EDNS options present [RFC6891]. 972 Check that EDNS version 1 DNSSEC queries work (EDNS supported): 974 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 975 $zone @$server 977 expect: status: BADVERS 978 expect: SOA record to NOT be present 979 expect: a OPT record to be present in the additional section 980 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 981 returned DO=1 982 expect: EDNS Version 0 in response 983 expect: flag: aa to NOT be present 985 +noednsneg disables EDNS version negotiation in DiG. 987 8.2.10. Testing With Multiple Defined EDNS Options 989 Ask for the SOA record of the zone the server is nominally configured 990 to serve. This query is made with no DNS flag bits set. EDNS 991 version 0 is used. A number of defined EDNS options are present 992 (NSID [RFC5001], DNS COOKIE [RFC7873], EDNS Client Subnet [RFC7871] 993 and EDNS Expire [RFC7314]). 995 We expect the SOA record for the zone to be returned in the answer 996 section with the rcode set to NOERROR and the AA and QR bits to be 997 set in the response, RA may also be set [RFC1034]. We expect a OPT 998 record to be returned. There should be no EDNS flags present in the 999 response. The EDNS version field should be zero. Any of the 1000 requested EDNS options supported by the server and permitted server 1001 configuration may be returned [RFC6891]. 1003 Check that EDNS queries with multiple defined EDNS options work: 1005 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 1006 soa $zone @$server 1008 expect: status: NOERROR 1009 expect: the SOA record to be present in the answer section 1010 expect: a OPT record to be present in the additional section 1011 expect: EDNS Version 0 in response 1012 expect: flag: aa to be present 1013 expect: flag: ad to NOT be present 1015 8.3. When EDNS Is Not Supported 1017 If EDNS is not supported by the nameserver, we expect a response to 1018 all the above queries. That response may be a FORMERR or NOTIMP 1019 error response or the OPT record may just be ignored. 1021 Some nameservers only return a EDNS response when a particular EDNS 1022 option or flag (e.g. DO=1) is present in the request. This 1023 behaviour is not compliant behaviour and may hide other incorrect 1024 behaviour from the above tests. Re-testing with the triggering 1025 option / flag present will expose this misbehaviour. 1027 9. Remediation 1029 Name server operators are generally expected to test their own 1030 infrastructure for compliance to standards. The above tests should 1031 be run when new systems are brought online, and should be repeated 1032 periodically to ensure continued interoperability. 1034 Domain registrants who do not maintain their own DNS infrastructure 1035 are entitled to a DNS service that conforms to standards and 1036 interoperates well. Registrants who become aware that their DNS 1037 operator does not have a well maintained or compliant infrastructure 1038 should insist that their service provider correct issues, and switch 1039 providers if they do not. 1041 In the event that an operator experiences problems due to the 1042 behaviour of name servers outside their control, the above tests will 1043 help in narrowing down the precise issue(s) which can then be 1044 reported to the relevant party. 1046 If contact information for the operator of a misbehaving name server 1047 is not already known, the following methods of communication could be 1048 considered: 1050 o the RNAME of the zone authoritative for the name of the 1051 misbehaving server 1053 o the RNAME of zones for which the offending server is authoritative 1055 o administrative or technical contacts listed in the registration 1056 information for the parent domain of the name of the misbehaving 1057 server, or for zones for which the name server is authoritative 1059 o the registrar or registry for such zones 1061 o DNS-specific operational fora (e.g. mailing lists) 1063 Operators of parent zones may wish to regularly test the 1064 authoritative name servers of their child zones. However, parent 1065 operators can have widely varying capabilities in terms of 1066 notification or remediation depending on whether they have a direct 1067 relationship with the child operator. Many TLD registries, for 1068 example, cannot directly contact their registrants and may instead 1069 need to communicate through the relevant registrar. In such cases 1070 it may be most efficient for registrars to take on the responsibility 1071 for testing the name servers of their registrants, since they have a 1072 direct relationship. 1074 When notification is not effective at correcting problems with a 1075 misbehaving name server, parent operators can choose to remove NS 1076 record sets (and glue records below) that refer to the faulty server. 1077 This should only be done as a last resort and with due consideration, 1078 as removal of a delegation can have unanticipated side effects. For 1079 example, other parts of the DNS tree may depend on names below the 1080 removed zone cut, and the parent operator may find themselves 1081 responsible for causing new DNS failures to occur. 1083 10. Security Considerations 1085 Testing protocol compliance can potentially result in false reports 1086 of attempts to break services from Intrusion Detection Services and 1087 firewalls. None of the tests listed above should break nominally 1088 EDNS compliant servers. None of the tests above should break non 1089 EDNS servers. All the tests above are well formed, though not 1090 necessarily common, DNS queries. 1092 Relaxing firewall settings to ensure EDNS compliance could 1093 potentially expose a critical implementation flaw in the nameserver. 1094 Nameservers should be tested for conformance before relaxing firewall 1095 settings. 1097 When removing delegations for non-compliant servers there can be a 1098 knock on effect on other zones that require these zones to be 1099 operational for the nameservers addresses to be resolved. 1101 11. IANA Considerations 1103 There are no actions for IANA. 1105 12. References 1107 12.1. Normative References 1109 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1110 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1111 . 1113 [RFC1035] Mockapetris, P., "Domain names - implementation and 1114 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1115 November 1987, . 1117 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1118 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1119 . 1121 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1122 Rose, "Protocol Modifications for the DNS Security 1123 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1124 . 1126 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1127 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1128 DOI 10.17487/RFC6840, February 2013, 1129 . 1131 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1132 for DNS (EDNS(0))", STD 75, RFC 6891, 1133 DOI 10.17487/RFC6891, April 2013, 1134 . 1136 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1137 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1138 April 2013, . 1140 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1141 D. Wessels, "DNS Transport over TCP - Implementation 1142 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1143 . 1145 12.2. Informative References 1147 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1148 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1149 . 1151 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1152 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1153 . 1155 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1156 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1157 . 1159 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1160 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1161 DOI 10.17487/RFC7871, May 2016, 1162 . 1164 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1165 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1166 . 1168 Author's Address 1170 M. Andrews 1171 Internet Systems Consortium 1172 950 Charter Street 1173 Redwood City, CA 94063 1174 US 1176 Email: marka@isc.org