idnits 2.17.1 draft-ietf-dnsop-no-response-issue-15.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 1019 has weird spacing: '...r zones for ...' -- The document date (March 8, 2020) is 1504 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 R. Bellis 4 Intended status: Best Current Practice ISC 5 Expires: September 9, 2020 March 8, 2020 7 A Common Operational Problem in DNS Servers - Failure To Communicate. 8 draft-ietf-dnsop-no-response-issue-15 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 zone operators to apply to 19 identify and remediate 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 September 9, 2020. 41 Copyright Notice 43 Copyright (c) 2020 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 kinds of queries that result in no or bad 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. TCP Queries . . . . . . . . . . . . . . . . . . . . . 6 67 3.2. EDNS Queries . . . . . . . . . . . . . . . . . . . . . . 6 68 3.2.1. EDNS Queries - Version Independent . . . . . . . . . 7 69 3.2.2. EDNS Queries - Version Specific . . . . . . . . . . . 7 70 3.2.3. EDNS Options . . . . . . . . . . . . . . . . . . . . 7 71 3.2.4. EDNS Flags . . . . . . . . . . . . . . . . . . . . . 7 72 3.2.5. Truncated EDNS Responses . . . . . . . . . . . . . . 8 73 3.2.6. DO=1 Handling . . . . . . . . . . . . . . . . . . . . 8 74 3.2.7. EDNS over TCP . . . . . . . . . . . . . . . . . . . . 8 75 4. Firewalls and Load Balancers . . . . . . . . . . . . . . . . 8 76 5. Scrubbing Services . . . . . . . . . . . . . . . . . . . . . 9 77 6. Whole Answer Caches . . . . . . . . . . . . . . . . . . . . . 10 78 7. Response Code Selection . . . . . . . . . . . . . . . . . . . 10 79 8. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 80 8.1. Testing - Basic DNS . . . . . . . . . . . . . . . . . . . 11 81 8.1.1. Is The Server Configured For The Zone? . . . . . . . 11 82 8.1.2. Testing Unknown Types . . . . . . . . . . . . . . . . 12 83 8.1.3. Testing Header Bits . . . . . . . . . . . . . . . . . 12 84 8.1.4. Testing Unknown Opcodes . . . . . . . . . . . . . . . 14 85 8.1.5. Testing TCP . . . . . . . . . . . . . . . . . . . . . 15 86 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 15 87 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 16 88 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 16 89 8.2.3. Testing Unknown EDNS Options . . . . . . . . . . . . 17 90 8.2.4. Testing Unknown EDNS Flags . . . . . . . . . . . . . 18 91 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS 92 Flags . . . . . . . . . . . . . . . . . . . . . . . . 18 93 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS 94 Options . . . . . . . . . . . . . . . . . . . . . . . 19 95 8.2.7. Testing Truncated Responses . . . . . . . . . . . . . 20 96 8.2.8. Testing DO=1 Handling . . . . . . . . . . . . . . . . 20 97 8.2.9. Testing EDNS Version Negotiation With DO=1 . . . . . 21 98 8.2.10. Testing With Multiple Defined EDNS Options . . . . . 21 99 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 22 100 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 22 101 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 102 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 103 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 104 12.1. Normative References . . . . . . . . . . . . . . . . . . 24 105 12.2. Informative References . . . . . . . . . . . . . . . . . 25 106 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25 108 1. Introduction 110 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failing 111 to respond to queries, or responding incorrectly, causes both 112 immediate operational problems and long term problems with protocol 113 development. 115 Failure to respond to a query is indistinguishable from packet loss 116 without doing an analysis of query-response patterns. Additionally 117 failure to respond results in unnecessary queries being made by DNS 118 clients, and introduces delays to the resolution process. 120 Due to the inability to distinguish between packet loss and 121 nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes 122 misclassified as lack of EDNS support which can lead to DNSSEC 123 validation failures. 125 The existence of servers which fail to respond to queries results in 126 developers being hesitant to deploy new standards. Such servers need 127 to be identified and remediated. 129 The DNS has response codes that cover almost any conceivable query 130 response. A nameserver should be able to respond to any conceivable 131 query using them. There should be no need to drop queries because a 132 nameserver does not understand them. 134 Unless a nameserver is under attack, it should respond to all DNS 135 requests directed to it. When a nameserver is under attack it may 136 wish to drop packets. A common attack is to use a nameserver as an 137 amplifier by sending spoofed packets. This is done because response 138 packets are bigger than the queries and large amplification factors 139 are available especially if EDNS is supported. Limiting the rate of 140 responses is reasonable when this is occurring and the client should 141 retry. This however only works if legitimate clients are not being 142 forced to guess whether EDNS queries are accepted or not. While 143 there is still a pool of servers that don't respond to EDNS requests, 144 clients have no way to know if the lack of response is due to packet 145 loss, or EDNS packets not being supported, or rate limiting due to 146 the server being under attack. Misclassification of server behaviour 147 is unavoidable when rate limiting is used until the population of 148 servers which fail to respond to well-formed queries drops to near 149 zero. 151 Nameservers should respond to queries even if the queried name is not 152 for any name the server is configured to answer for. Misconfigured 153 nameservers are a common occurrence in the DNS and receiving queries 154 for zones that the server is not configured for is not necessarily an 155 indication that the server is under attack. Parent zone operators 156 are advised to regularly check that the delegating NS records are 157 consistent with those of the delegated zone and to correct them when 158 they are not [RFC1034]. Doing this regularly should reduce the 159 instances of broken delegations. 161 This document does not try to identify all possible errors nor does 162 it supply an exhaustive list of tests. 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. In particular the 172 base DNS specification [RFC1034], [RFC1035] and the EDNS 173 specification [RFC6891], when implemented, need to be followed. 175 Some examples of known consequences include: 177 o The AD flag bit in a response cannot be trusted to mean anything 178 as some servers incorrectly copy the flag bit from the request to 179 the response [RFC1035], [RFC4035]. 181 o Widespread non-response to EDNS queries has lead to recursive 182 servers having to assume that EDNS is not supported and that 183 fallback to plain DNS is required, potentially causing DNSSEC 184 validation failures. 186 o Widespread non-response to EDNS options, requires recursive 187 servers to have to decide whether to probe to see if it is the 188 EDNS option or just EDNS that is causing the non response. In the 189 limited amount of time required to resolve a query before the 190 client times out this is not possible. 192 o Incorrectly returning FORMERR to an EDNS option being present, 193 leads to the recursive server not being able to determine if the 194 server is just broken in the handling of the EDNS option or 195 doesn't support EDNS at all. 197 o Mishandling of unknown query types has contributed to the 198 abandonment of the transition of the SPF type. 200 o Mishandling of unknown query types has slowed up the development 201 of DANE and resulted in additional rules being specified to reduce 202 the probability of interacting with a broken server when making 203 TLSA queries. 205 The consequences of servers not following the RFCs will only grow if 206 measures are not put in place to remove non compliant servers from 207 the ecosystem. Working around issues due to non-compliance with RFCs 208 is not sustainable. 210 Most (if not all) of these consequences could have been avoided if 211 action had been taken to remove non-compliant servers as soon as 212 people were aware of them, i.e. to actively seek out broken 213 implementations and servers and inform their developers and operators 214 that they need to fix their servers. 216 3. Common kinds of queries that result in no or bad responses. 218 This section is broken down into Basic DNS requests and EDNS 219 requests. 221 3.1. Basic DNS Queries 223 3.1.1. Zone Existence 225 If a zone is delegated to a server, that server should respond to an 226 SOA query for that zone with an SOA record. Failing to respond at 227 all is always incorrect, regardless of the configuration of the 228 server. Responding with anything other than an SOA record in the 229 Answer section indicates a bad delegation. 231 3.1.2. Unknown / Unsupported Type Queries 233 Some servers fail to respond to unknown or unsupported types. If a 234 server receives a query for a type that it doesn't recognize, or 235 doesn't implement, it is expected to return the appropriate response 236 as if it did recognize the type but does not have any data for that 237 type: either NOERROR, or NXDOMAIN. The exception to this are queries 238 for Meta-RR types which may return NOTIMP. 240 3.1.3. DNS Flags 242 Some servers fail to respond to DNS queries with various DNS flags 243 set, regardless of whether they are defined or still reserved. At 244 the time of writing there are servers that fail to respond to queries 245 with the AD bit set to 1 and servers that fail to respond to queries 246 with the last reserved flag bit set. 248 3.1.3.1. Recursive Queries 250 A non-recursive server is supposed to respond to recursive queries as 251 if the RD bit is not set [RFC1034]. 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. TCP Queries 267 All DNS servers are supposed to respond to queries over TCP 268 [RFC7766]. While firewalls should not block TCP connection attempts 269 if they do they should cleanly terminate the connection by sending 270 TCP RESET or sending ICMP/ICMPv6 Administratively Prohibited 271 messages. Dropping TCP connections introduces excessive delays to 272 the resolution process. 274 Whether a server accepts TCP connections can be tested by first 275 checking that it responds to UDP queries to confirm that it is up and 276 operating, then attempting the same query over TCP. An additional 277 query should be made over UDP if the TCP connection attempt fails to 278 confirm that the server under test is still operating. 280 3.2. EDNS Queries 282 EDNS queries are specified in [RFC6891]. 284 3.2.1. EDNS Queries - Version Independent 286 Identifying servers that fail to respond to EDNS queries can be done 287 by first confirming that the server responds to regular DNS queries, 288 followed by a series of otherwise identical queries using EDNS, then 289 making the original query again. A series of EDNS queries is needed 290 as at least one DNS implementation responds to the first EDNS query 291 with FORMERR but fails to respond to subsequent queries from the same 292 address for a period until a regular DNS query is made. The EDNS 293 query should specify a UDP buffer size of 512 bytes to avoid false 294 classification of not supporting EDNS due to response packet size. 296 If the server responds to the first and last queries but fails to 297 respond to most or all of the EDNS queries, it is probably faulty. 298 The test should be repeated a number of times to eliminate the 299 likelihood of a false positive due to packet loss. 301 Firewalls may also block larger EDNS responses but there is no easy 302 way to check authoritative servers to see if the firewall is mis- 303 configured. 305 3.2.2. EDNS Queries - Version Specific 307 Some servers respond correctly to EDNS version 0 queries but fail to 308 respond to EDNS queries with version numbers that are higher than 309 zero. Servers should respond with BADVERS to EDNS queries with 310 version numbers that they do not support. 312 Some servers respond correctly to EDNS version 0 queries but fail to 313 set QR=1 when responding to EDNS versions they do not support. Such 314 answers are discarded or treated as requests. 316 3.2.3. EDNS Options 318 Some servers fail to respond to EDNS queries with EDNS options set. 319 Unknown EDNS options are supposed to be ignored by the server 320 [RFC6891], the original EDNS specification left this behaviour 321 undefined [RFC2671]. 323 3.2.4. EDNS Flags 325 Some servers fail to respond to EDNS queries with EDNS flags set. 326 Servers should ignore EDNS flags they do not understand and must not 327 add them to the response [RFC6891]. 329 3.2.5. Truncated EDNS Responses 331 Some EDNS aware servers fail to include an OPT record when a 332 truncated response is sent. An OPT record is supposed to be included 333 in a truncated response [RFC6891]. 335 Some EDNS aware server fail to honour the advertised EDNS buffer size 336 and send over-sized responses [RFC6891]. 338 3.2.6. DO=1 Handling 340 Some nameservers incorrectly only return an EDNS response when the DO 341 bit [RFC3225] is 1 in the query. Additionally some nameservers fail 342 to copy the DO bit to the response despite clearly supporting DNSSEC 343 by returning an RRSIG records to EDNS queries with DO=1. 345 3.2.7. EDNS over TCP 347 Some EDNS aware servers incorrectly limit the TCP response sizes to 348 the advertised UDP response size. 350 4. Firewalls and Load Balancers 352 Firewalls and load balancers can affect the externally visible 353 behaviour of a nameserver. Tests for conformance should to be done 354 from outside of any firewall so that the system is tested as a whole. 356 Firewalls and load balancers should not drop DNS packets that they 357 don't understand. They should either pass the packets or generate an 358 appropriate error response. 360 Requests for unknown query types are normal client behaviour and 361 should not be construed as an attack. Nameservers have always been 362 expected to be able to handle such queries. 364 Requests for unknown query classes are normal client behaviour and 365 should not be construed as an attack. Nameservers have always been 366 expected to be able to handle such queries. 368 Requests with unknown opcodes are normal client behaviour and should 369 not be construed as an attack. Nameservers have always been expected 370 to be able to handle such queries. 372 Requests with unassigned flags set (DNS or EDNS) are expected client 373 behaviour and should not be construed as an attack. The behaviour 374 for unassigned flags is to ignore them in the request and to not set 375 them in the response. Dropping DNS / EDNS packets with unassigned 376 flags makes it difficult to deploy extensions that make use of them 377 due to the need to reconfigure and update firewalls. 379 Requests with unknown EDNS options are expected client behaviour and 380 should not be construed as an attack. The correct behaviour for 381 unknown EDNS options is to ignore their presence when constructing a 382 reply. 384 Requests with unknown EDNS versions are expected client behaviour and 385 should not be construed as an attack. The correct behaviour for 386 unknown EDNS versions is to return BADVERS along with the highest 387 EDNS version the server supports. Dropping EDNS packets breaks EDNS 388 version negotiation. 390 Firewalls should not assume that there will only be a single response 391 message to a request. There have been proposals to use EDNS to 392 signal that multiple DNS messages be returned rather than a single 393 UDP message that is fragmented at the IP layer. 395 DNS, and EDNS in particular, are designed to allow clients to be able 396 to use new features against older servers without having to validate 397 every option. Indiscriminate blocking of messages breaks that 398 design. 400 However, there may be times when a nameserver mishandles messages 401 with a particular flag, EDNS option, EDNS version field, opcode, type 402 or class field or combination thereof to the point where the 403 integrity of the nameserver is compromised. Firewalls should offer 404 the ability to selectively reject messages using an appropriately 405 constructed response based on all these fields while awaiting a fix 406 from the nameserver vendor. 408 5. Scrubbing Services 410 Scrubbing services can affect the externally visible behaviour of a 411 nameserver in a similar way to firewalls. If an operator uses a 412 scrubbing service, they should check that legitimate queries are not 413 being blocked. 415 Scrubbing services, unlike firewalls, are also turned on and off in 416 response to denial of service attacks. One needs to take care when 417 choosing a scrubbing service. 419 Ideally, Operators should run these tests against a scrubbing service 420 to ensure that these tests are not seen as attack vectors. 422 6. Whole Answer Caches 424 Whole answer caches take a previously constructed answer and return 425 it to a subsequent query for the same question. However, they can 426 return the wrong response if they do not take all of the relevant 427 attributes of the query into account. 429 In addition to the standard tuple of a non- 430 exhaustive set of attributes that must be considered include: RD, AD, 431 CD, OPT record, DO, EDNS buffer size, EDNS version, EDNS options, and 432 transport. 434 7. Response Code Selection 436 Choosing the correct response code when responding to DNS queries is 437 important. Response codes should be chosen considering how clients 438 will handle them. 440 For unimplemented opcodes NOTIMP is the expected response code. For 441 example, a new opcode could change the message format by extending 442 the header or changing the structure of the records etc. 444 For unimplemented type codes, and in the absence of other errors, the 445 only valid response is NoError if the qname exists, and NameError 446 (NXDOMAIN) otherwise. For Meta-RRs NOTIMP may be returned instead. 448 If a zone cannot be loaded because it contains unimplemented type 449 codes that are not encoded as unknown record types according to 450 [RFC3597] then the expected response is SERVFAIL as the whole zone 451 should be rejected Section 5.2 [RFC1035]. If a zone loads then 452 Section 4.3.2 [RFC1034] applies. 454 If the server supports EDNS and receives a query with an unsupported 455 EDNS version, the correct response is BADVERS [RFC6891]. 457 If the server does not support EDNS at all, FORMERR is the expected 458 error code. That said a minimal EDNS server implementation requires 459 parsing the OPT records and responding with an empty OPT record in 460 the additional section in most cases. There is no need to interpret 461 any EDNS options present in the request as unsupported EDNS options 462 are expected to be ignored [RFC6891]. Additionally EDNS flags can be 463 ignored. The only part of the OPT record that needs to be examined 464 is the version field to determine if BADVERS needs to be sent or not. 466 8. Testing 468 Testing is divided into two sections. "Basic DNS", which all servers 469 should meet, and "Extended DNS", which should be met by all servers 470 that support EDNS (a server is deemed to support EDNS if it gives a 471 valid EDNS response to any EDNS query). If a server does not support 472 EDNS it should still respond to all the tests. 474 These tests query for records at the apex of a zone that the server 475 is nominally configured to serve. All tests should use the same 476 zone. 478 It is advisable to run all of the tests below in parallel so as to 479 minimise the delays due to multiple timeouts when the servers do not 480 respond. There are 16 queries directed to each nameserver (assuming 481 no packet loss) testing different aspects of Basic DNS and Extended 482 DNS. 484 The tests below use dig from BIND 9.11.0. 486 8.1. Testing - Basic DNS 488 This first set of tests cover basic DNS server behaviour and all 489 servers should pass these tests. 491 8.1.1. Is The Server Configured For The Zone? 493 Ask for the SOA record of the configured zone. This query is made 494 with no DNS flag bits set and without EDNS. 496 We expect the SOA record for the zone to be returned in the answer 497 section with the rcode set to NOERROR and the AA and QR bits to be 498 set in the response; RA may also be set [RFC1034]. We do not expect 499 an OPT record to be returned [RFC6891]. 501 Verify the server is configured for the zone: 503 dig +noedns +noad +norec soa $zone @$server 505 expect: status: NOERROR 506 expect: the SOA record to be present in the answer section 507 expect: flag: aa to be present 508 expect: flag: rd to NOT be present 509 expect: flag: ad to NOT be present 510 expect: the OPT record to NOT be present 512 8.1.2. Testing Unknown Types 514 Identifying servers that fail to respond to unknown or unsupported 515 types can be done by making an initial DNS query for an A record, 516 making a number of queries for an unallocated type, then making a 517 query for an A record again. IANA maintains a registry of allocated 518 types. 520 If the server responds to the first and last queries but fails to 521 respond to the queries for the unallocated type, it is probably 522 faulty. The test should be repeated a number of times to eliminate 523 the likelihood of a false positive due to packet loss. 525 Ask for the TYPE1000 RRset at the configured zone's name. This query 526 is made with no DNS flag bits set and without EDNS. TYPE1000 has 527 been chosen for this purpose as IANA is unlikely to allocate this 528 type in the near future and it is not in a range reserved for private 529 use [RFC6895]. Any unallocated type code could be chosen for this 530 test. 532 We expect no records to be returned in the answer section with the 533 rcode set to NOERROR and the AA and QR bits to be set in the 534 response; RA may also be set [RFC1034]. We do not expect an OPT 535 record to be returned [RFC6891]. 537 Check that queries for an unknown type work: 539 dig +noedns +noad +norec type1000 $zone @$server 541 expect: status: NOERROR 542 expect: an empty answer section. 543 expect: flag: aa to be present 544 expect: flag: rd to NOT be present 545 expect: flag: ad to NOT be present 546 expect: the OPT record to NOT be present 548 8.1.3. Testing Header Bits 550 8.1.3.1. Testing CD=1 Queries 552 Ask for the SOA record of the configured zone. This query is made 553 with only the CD DNS flag bit set, all other DNS bits clear, and 554 without EDNS. 556 We expect the SOA record for the zone to be returned in the answer 557 section with the rcode set to NOERROR and the AA and QR bits to be 558 set in the response. We do not expect an OPT record to be returned. 560 If the server supports DNSSEC, CD should be set in the response 561 [RFC4035] otherwise CD should be clear [RFC1034]. 563 Check that queries with CD=1 work: 565 dig +noedns +noad +norec +cd soa $zone @$server 567 expect: status: NOERROR 568 expect: the SOA record to be present in the answer section 569 expect: flag: aa to be present 570 expect: flag: rd to NOT be present 571 expect: flag: ad to NOT be present 572 expect: the OPT record to NOT be present 574 8.1.3.2. Testing AD=1 Queries 576 Ask for the SOA record of the configured zone. This query is made 577 with only the AD DNS flag bit set and all other DNS bits clear and 578 without EDNS. 580 We expect the SOA record for the zone to be returned in the answer 581 section with the rcode set to NOERROR and the AA and QR bits to be 582 set in the response. We do not expect an OPT record to be returned. 583 The purpose of this query is to detect blocking of queries with the 584 AD bit present, not the specific value of AD in the response. 586 Check that queries with AD=1 work: 588 dig +noedns +norec +ad soa $zone @$server 590 expect: status: NOERROR 591 expect: the SOA record to be present in the answer section 592 expect: flag: aa to be present 593 expect: flag: rd to NOT be present 594 expect: the OPT record to NOT be present 596 AD use in queries is defined in [RFC6840]. 598 8.1.3.3. Testing Reserved Bit 600 Ask for the SOA record of the configured zone. This query is made 601 with only the final reserved DNS flag bit set and all other DNS bits 602 clear and without EDNS. 604 We expect the SOA record for the zone to be returned in the answer 605 section with the rcode set to NOERROR and the AA and QR bits to be 606 set in the response; RA may be set. The final reserved bit must not 607 be set [RFC1034]. We do not expect an OPT record to be returned 608 [RFC6891]. 610 Check that queries with the last unassigned DNS header flag work and 611 that the flag bit is not copied to the response: 613 dig +noedns +noad +norec +zflag soa $zone @$server 615 expect: status: NOERROR 616 expect: the SOA record to be present in the answer section 617 expect: MBZ to NOT be in the response (see below) 618 expect: flag: aa to be present 619 expect: flag: rd to NOT be present 620 expect: flag: ad to NOT be present 621 expect: the OPT record to NOT be present 623 MBZ (Must Be Zero) is a dig-specific indication that the flag bit has 624 been incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved 625 for future use. Must be zero in all queries and responses." 627 8.1.3.4. Testing Recursive Queries 629 Ask for the SOA record of the configured zone. This query is made 630 with only the RD DNS flag bit set and without EDNS. 632 We expect the SOA record for the zone to be returned in the answer 633 section with the rcode set to NOERROR and the AA, QR and RD bits to 634 be set in the response; RA may also be set [RFC1034]. We do not 635 expect an OPT record to be returned [RFC6891]. 637 Check that recursive queries work: 639 dig +noedns +noad +rec soa $zone @$server 641 expect: status: NOERROR 642 expect: the SOA record to be present in the answer section 643 expect: flag: aa to be present 644 expect: flag: rd to be present 645 expect: flag: ad to NOT be present 646 expect: the OPT record to NOT be present 648 8.1.4. Testing Unknown Opcodes 650 Construct a DNS message that consists of only a DNS header with 651 opcode set to 15 (currently not allocated), no DNS header bits set 652 and empty question, answer, authority and additional sections. 654 Check that new opcodes are handled: 656 dig +noedns +noad +opcode=15 +norec +header-only @$server 658 expect: status: NOTIMP 659 expect: opcode: 15 660 expect: all sections to be empty 661 expect: flag: aa to NOT be present 662 expect: flag: rd to NOT be present 663 expect: flag: ad to NOT be present 664 expect: the OPT record to NOT be present 666 8.1.5. Testing TCP 668 Ask for the SOA record of the configured zone. This query is made 669 with no DNS flag bits set and without EDNS. This query is to be sent 670 using TCP. 672 We expect the SOA record for the zone to be returned in the answer 673 section with the rcode set to NOERROR and the AA and QR bits to be 674 set in the response; RA may also be set [RFC1034]. We do not expect 675 an OPT record to be returned [RFC6891]. 677 Check that TCP queries work: 679 dig +noedns +noad +norec +tcp soa $zone @$server 681 expect: status: NOERROR 682 expect: the SOA record to be present in the answer section 683 expect: flag: aa to be present 684 expect: flag: rd to NOT be present 685 expect: flag: ad to NOT be present 686 expect: the OPT record to NOT be present 688 The requirement that TCP be supported is defined in [RFC7766]. 690 8.2. Testing - Extended DNS 692 The next set of tests cover various aspects of EDNS behaviour. If 693 any of these tests succeed (indicating at least some EDNS support) 694 then all of them should succeed. There are servers that support EDNS 695 but fail to handle plain EDNS queries correctly so a plain EDNS query 696 is not a good indicator of lack of EDNS support. 698 8.2.1. Testing Minimal EDNS 700 Ask for the SOA record of the configured zone. This query is made 701 with no DNS flag bits set. EDNS version 0 is used without any EDNS 702 options or EDNS flags set. 704 We expect the SOA record for the zone to be returned in the answer 705 section with the rcode set to NOERROR and the AA and QR bits to be 706 set in the response; RA may also be set [RFC1034]. We expect an OPT 707 record to be returned. There should be no EDNS flags present in the 708 response. The EDNS version field should be 0 and there should be no 709 EDNS options present [RFC6891]. 711 Check that plain EDNS queries work: 713 dig +nocookie +edns=0 +noad +norec soa $zone @$server 715 expect: status: NOERROR 716 expect: the SOA record to be present in the answer section 717 expect: an OPT record to be present in the additional section 718 expect: EDNS Version 0 in response 719 expect: flag: aa to be present 720 expect: flag: ad to NOT be present 722 +nocookie disables sending a EDNS COOKIE option which is otherwise 723 enabled by default in BIND 9.11.0 (and later). 725 8.2.2. Testing EDNS Version Negotiation 727 Ask for the SOA record of a zone the server is nominally configured 728 to serve. This query is made with no DNS flag bits set. EDNS 729 version 1 is used without any EDNS options or EDNS flags set. 731 We expect the SOA record for the zone to NOT be returned in the 732 answer section with the extended rcode set to BADVERS and the QR bit 733 to be set in the response; RA may also be set [RFC1034]. We expect 734 an OPT record to be returned. There should be no EDNS flags present 735 in the response. The EDNS version field should be 0 in the response 736 as no other EDNS version has as yet been specified [RFC6891]. 738 Check that EDNS version 1 queries work (EDNS supported): 740 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 742 expect: status: BADVERS 743 expect: the SOA record to NOT be present in the answer section 744 expect: an OPT record to be present in the additional section 745 expect: EDNS Version 0 in response 746 expect: flag: aa to NOT be present 747 expect: flag: ad to NOT be present 749 +noednsneg has been set as dig supports EDNS version negotiation and 750 we want to see only the response to the initial EDNS version 1 query. 752 8.2.3. Testing Unknown EDNS Options 754 Ask for the SOA record of the configured zone. This query is made 755 with no DNS flag bits set. EDNS version 0 is used without any EDNS 756 flags. An EDNS option is present with a value that has not yet been 757 assigned by IANA. We have picked an unassigned code of 100 for the 758 example below. Any unassigned EDNS option code could have been 759 choosen for this test. 761 We expect the SOA record for the zone to be returned in the answer 762 section with the rcode set to NOERROR and the AA and QR bits to be 763 set in the response; RA may also be set [RFC1034]. We expect an OPT 764 record to be returned. There should be no EDNS flags present in the 765 response. The EDNS version field should be 0 as EDNS versions other 766 than 0 are yet to be specified and there should be no EDNS options 767 present as unknown EDNS options are supposed to be ignored by the 768 server [RFC6891] Section 6.1.2. 770 Check that EDNS queries with an unknown option work (EDNS supported): 772 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 774 expect: status: NOERROR 775 expect: the SOA record to be present in the answer section 776 expect: an OPT record to be present in the additional section 777 expect: OPT=100 to NOT be present 778 expect: EDNS Version 0 in response 779 expect: flag: aa to be present 780 expect: flag: ad to NOT be present 782 8.2.4. Testing Unknown EDNS Flags 784 Ask for the SOA record of the configured zone. This query is made 785 with no DNS flag bits set. EDNS version 0 is used without any EDNS 786 options. An unassigned EDNS flag bit is set (0x40 in this case). 788 We expect the SOA record for the zone to be returned in the answer 789 section with the rcode set to NOERROR and the AA and QR bits to be 790 set in the response; RA may also be set [RFC1034]. We expect an OPT 791 record to be returned. There should be no EDNS flags present in the 792 response as unknown EDNS flags are supposed to be ignored. The EDNS 793 version field should be 0 and there should be no EDNS options present 794 [RFC6891]. 796 Check that EDNS queries with unknown flags work (EDNS supported): 798 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 800 expect: status: NOERROR 801 expect: the SOA record to be present in the answer section 802 expect: an OPT record to be present in the additional section 803 expect: MBZ not to be present 804 expect: EDNS Version 0 in response 805 expect: flag: aa to be present 806 expect: flag: ad to NOT be present 808 MBZ (Must Be Zero) is a dig-specific indication that a flag bit has 809 been incorrectly copied as per Section 6.1.4, [RFC6891]. 811 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 813 Ask for the SOA record of the configured zone. This query is made 814 with no DNS flag bits set. EDNS version 1 is used without any EDNS 815 options. An unassigned EDNS flag bit is set (0x40 in this case). 817 We expect the SOA record for the zone to NOT be returned in the 818 answer section with the extended rcode set to BADVERS and the QR bit 819 to be set in the response; RA may also be set [RFC1034]. We expect 820 an OPT record to be returned. There should be no EDNS flags present 821 in the response as unknown EDNS flags are supposed to be ignored. 822 The EDNS version field should be 0 as EDNS versions other than 0 are 823 yet to be specified and there should be no EDNS options present 824 [RFC6891]. 826 Check that EDNS version 1 queries with unknown flags work (EDNS 827 supported): 829 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 830 $zone @$server 832 expect: status: BADVERS 833 expect: SOA record to NOT be present 834 expect: an OPT record to be present in the additional section 835 expect: MBZ not to be present 836 expect: EDNS Version 0 in response 837 expect: flag: aa to NOT be present 838 expect: flag: ad to NOT be present 840 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 842 Ask for the SOA record of the configured zone. This query is made 843 with no DNS flag bits set. EDNS version 1 is used. An unknown EDNS 844 option is present. We have picked an unassigned code of 100 for the 845 example below. Any unassigned EDNS option code could have been 846 chosen for this test. 848 We expect the SOA record for the zone to NOT be returned in the 849 answer section with the extended rcode set to BADVERS and the QR bit 850 to be set in the response; RA may also be set [RFC1034]. We expect 851 an OPT record to be returned. There should be no EDNS flags present 852 in the response. The EDNS version field should be 0 as EDNS versions 853 other than 0 are yet to be specified and there should be no EDNS 854 options present [RFC6891]. 856 Check that EDNS version 1 queries with unknown options work (EDNS 857 supported): 859 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 860 $zone @$server 862 expect: status: BADVERS 863 expect: SOA record to NOT be present 864 expect: an OPT record to be present in the additional section 865 expect: OPT=100 to NOT be present 866 expect: EDNS Version 0 in response 867 expect: flag: aa to NOT be present 868 expect: flag: ad to NOT be present 870 8.2.7. Testing Truncated Responses 872 Ask for the DNSKEY records of the configured zone, which must be a 873 DNSSEC signed zone. This query is made with no DNS flag bits set. 874 EDNS version 0 is used without any EDNS options. The only EDNS flag 875 set is DO. The EDNS UDP buffer size is set to 512. The intention of 876 this query is to elicit a truncated response from the server. Most 877 signed DNSKEY responses are bigger than 512 bytes. This test will 878 not give a valid result if the zone is not signed. 880 We expect a response with the rcode set to NOERROR and the AA and QR 881 bits to be set, AD may be set in the response if the server supports 882 DNSSEC otherwise it should be clear; TC and RA may also be set 883 [RFC1035] [RFC4035]. We expect an OPT record to be present in the 884 response. There should be no EDNS flags other than DO present in the 885 response. The EDNS version field should be 0 and there should be no 886 EDNS options present [RFC6891]. 888 If TC is not set it is not possible to confirm that the server 889 correctly adds the OPT record to the truncated responses or not. 891 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 892 expect: NOERROR 893 expect: OPT record with version set to 0 895 8.2.8. Testing DO=1 Handling 897 Ask for the SOA record of the configured zone, which does not need to 898 be DNSSEC signed. This query is made with no DNS flag bits set. 899 EDNS version 0 is used without any EDNS options. The only EDNS flag 900 set is DO. 902 We expect the SOA record for the zone to be returned in the answer 903 section with the rcode set to NOERROR and the AA and QR bits to be 904 set in the response, AD may be set in the response if the server 905 supports DNSSEC otherwise it should be clear; RA may also be set 906 [RFC1034]. We expect an OPT record to be returned. There should be 907 no EDNS flags other than DO present in the response which should be 908 present if the server supports DNSSEC. The EDNS version field should 909 be 0 and there should be no EDNS options present [RFC6891]. 911 Check that DO=1 queries work (EDNS supported): 913 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 915 expect: status: NOERROR 916 expect: the SOA record to be present in the answer section 917 expect: an OPT record to be present in the additional section 918 expect: DO=1 to be present if an RRSIG is in the response 919 expect: EDNS Version 0 in response 920 expect: flag: aa to be present 922 8.2.9. Testing EDNS Version Negotiation With DO=1 924 Ask for the SOA record of the configured zone, which does not need to 925 be DNSSEC signed. This query is made with no DNS flag bits set. 926 EDNS version 1 is used without any EDNS options. The only EDNS flag 927 set is DO. 929 We expect the SOA record for the zone to NOT be returned in the 930 answer section with the rcode set to BADVERS; the QR bit and possibly 931 the RA bit to be set [RFC1034]. We expect an OPT record to be 932 returned. There should be no EDNS flags other than DO present in the 933 response which should be there if the server supports DNSSEC. The 934 EDNS version field should be 0 and there should be no EDNS options 935 present [RFC6891]. 937 Check that EDNS version 1, DO=1 queries work (EDNS supported): 939 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 940 $zone @$server 942 expect: status: BADVERS 943 expect: SOA record to NOT be present 944 expect: an OPT record to be present in the additional section 945 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 946 returned DO=1 947 expect: EDNS Version 0 in response 948 expect: flag: aa to NOT be present 950 8.2.10. Testing With Multiple Defined EDNS Options 952 Ask for the SOA record of the configured zone. This query is made 953 with no DNS flag bits set. EDNS version 0 is used. A number of 954 defined EDNS options are present (NSID [RFC5001], DNS COOKIE 955 [RFC7873], EDNS Client Subnet [RFC7871] and EDNS Expire [RFC7314]). 957 We expect the SOA record for the zone to be returned in the answer 958 section with the rcode set to NOERROR and the AA and QR bits to be 959 set in the response; RA may also be set [RFC1034]. We expect an OPT 960 record to be returned. There should be no EDNS flags present in the 961 response. The EDNS version field should be 0. Any of the requested 962 EDNS options supported by the server and permitted server 963 configuration may be returned [RFC6891]. 965 Check that EDNS queries with multiple defined EDNS options work: 967 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 968 soa $zone @$server 970 expect: status: NOERROR 971 expect: the SOA record to be present in the answer section 972 expect: an OPT record to be present in the additional section 973 expect: EDNS Version 0 in response 974 expect: flag: aa to be present 975 expect: flag: ad to NOT be present 977 8.3. When EDNS Is Not Supported 979 If EDNS is not supported by the nameserver, we expect a response to 980 each of the above queries. That response may be a FORMERR error 981 response or the OPT record may just be ignored. 983 Some nameservers only return a EDNS response when a particular EDNS 984 option or flag (e.g. DO=1) is present in the request. This 985 behaviour is not compliant behaviour and may hide other incorrect 986 behaviour from the above tests. Re-testing with the triggering 987 option / flag present will expose this misbehaviour. 989 9. Remediation 991 Name server operators are generally expected to test their own 992 infrastructure for compliance to standards. The above tests should 993 be run when new systems are brought online, and should be repeated 994 periodically to ensure continued interoperability. 996 Domain registrants who do not maintain their own DNS infrastructure 997 are entitled to a DNS service that conforms to standards and 998 interoperates well. Registrants who become aware that their DNS 999 operator does not have a well maintained or compliant infrastructure 1000 should insist that their service provider correct issues, and switch 1001 providers if they do not. 1003 In the event that an operator experiences problems due to the 1004 behaviour of name servers outside their control, the above tests will 1005 help in narrowing down the precise issue(s) which can then be 1006 reported to the relevant party. 1008 If contact information for the operator of a misbehaving name server 1009 is not already known, the following methods of communication could be 1010 considered: 1012 o the RNAME of the zone authoritative for the name of the 1013 misbehaving server 1015 o the RNAME of zones for which the offending server is authoritative 1017 o administrative or technical contacts listed in the registration 1018 information for the parent domain of the name of the misbehaving 1019 server, or for zones for which the name server is authoritative 1021 o the registrar or registry for such zones 1023 o DNS-specific operational fora (e.g. mailing lists) 1025 Operators of parent zones may wish to regularly test the 1026 authoritative name servers of their child zones. However, parent 1027 operators can have widely varying capabilities in terms of 1028 notification or remediation depending on whether they have a direct 1029 relationship with the child operator. Many TLD registries, for 1030 example, cannot directly contact their registrants and may instead 1031 need to communicate through the relevant registrar. In such cases 1032 it may be most efficient for registrars to take on the responsibility 1033 for testing the name servers of their registrants, since they have a 1034 direct relationship. 1036 When notification is not effective at correcting problems with a 1037 misbehaving name server, parent operators can choose to remove NS 1038 record sets (and glue records below) that refer to the faulty server 1039 until the servers are fixed. This should only be done as a last 1040 resort and with due consideration, as removal of a delegation can 1041 have unanticipated side effects. For example, other parts of the DNS 1042 tree may depend on names below the removed zone cut, and the parent 1043 operator may find themselves responsible for causing new DNS failures 1044 to occur. 1046 10. Security Considerations 1048 Testing protocol compliance can potentially result in false reports 1049 of attempts to break services from Intrusion Detection Services and 1050 firewalls. All of the tests are well-formed (though not necessarily 1051 common) DNS queries. None the tests listed above should cause any 1052 harm to a protocol-compliant server. 1054 Relaxing firewall settings to ensure EDNS compliance could 1055 potentially expose a critical implementation flaw in the nameserver. 1057 Nameservers should be tested for conformance before relaxing firewall 1058 settings. 1060 When removing delegations for non-compliant servers there can be a 1061 knock on effect on other zones that require these zones to be 1062 operational for the nameservers addresses to be resolved. 1064 11. IANA Considerations 1066 There are no actions for IANA. 1068 12. References 1070 12.1. Normative References 1072 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1073 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1074 . 1076 [RFC1035] Mockapetris, P., "Domain names - implementation and 1077 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1078 November 1987, . 1080 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1081 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1082 . 1084 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1085 Rose, "Protocol Modifications for the DNS Security 1086 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1087 . 1089 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1090 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1091 DOI 10.17487/RFC6840, February 2013, 1092 . 1094 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1095 for DNS (EDNS(0))", STD 75, RFC 6891, 1096 DOI 10.17487/RFC6891, April 2013, 1097 . 1099 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1100 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1101 April 2013, . 1103 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1104 D. Wessels, "DNS Transport over TCP - Implementation 1105 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1106 . 1108 12.2. Informative References 1110 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1111 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1112 . 1114 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record 1115 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 1116 2003, . 1118 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1119 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1120 . 1122 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1123 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1124 . 1126 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1127 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1128 DOI 10.17487/RFC7871, May 2016, 1129 . 1131 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1132 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1133 . 1135 Authors' Addresses 1137 M. Andrews 1138 Internet Systems Consortium 1139 950 Charter Street 1140 Redwood City, CA 94063 1141 US 1143 Email: marka@isc.org 1144 Ray Bellis 1145 Internet Systems Consortium 1146 950 Charter Street 1147 Redwood City, CA 94063 1148 US 1150 Email: ray@isc.org