idnits 2.17.1 draft-ietf-dnsop-no-response-issue-14.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 1010 has weird spacing: '...r zones for ...' -- The document date (November 4, 2019) is 1635 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: May 7, 2020 November 4, 2019 7 A Common Operational Problem in DNS Servers - Failure To Communicate. 8 draft-ietf-dnsop-no-response-issue-14 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 May 7, 2020. 41 Copyright Notice 43 Copyright (c) 2019 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 a 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 a 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 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 an indication of a bad delegation. 229 3.1.2. Unknown / Unsupported Type Queries 231 Identifying servers that fail to respond to unknown or unsupported 232 types can be done by making an initial DNS query for an A record, 233 making a number of queries for an unallocated type, then making a 234 query for an A record again. IANA maintains a registry of allocated 235 types. 237 If the server responds to the first and last queries but fails to 238 respond to the queries for the unallocated type, it is probably 239 faulty. The test should be repeated a number of times to eliminate 240 the likelihood of a false positive due to packet loss. 242 3.1.3. DNS Flags 244 Some servers fail to respond to DNS queries with various DNS flags 245 set, regardless of whether they are defined or still reserved. At 246 the time of writing there are servers that fail to respond to queries 247 with the AD bit set to 1 and servers that fail to respond to queries 248 with the last reserved flag bit set. 250 3.1.3.1. Recursive Queries 252 A non-recursive server is supposed to respond to recursive queries as 253 if the RD bit is not set [RFC1034]. 255 3.1.4. Unknown DNS opcodes 257 The use of previously undefined opcodes is to be expected. Since the 258 DNS was first defined two new opcodes have been added, UPDATE and 259 NOTIFY. 261 NOTIMP is the expected rcode to an unknown or unimplemented opcode. 263 Note: while new opcodes will most probably use the current layout 264 structure for the rest of the message there is no requirement that 265 anything other than the DNS header match. 267 3.1.5. TCP Queries 269 All DNS servers are supposed to respond to queries over TCP 270 [RFC7766]. While firewalls should not block TCP connection attempts 271 if they do they should cleanly terminate the connection by sending 272 TCP RESET or sending ICMP/ICMPv6 Administratively Prohibited 273 messages. Dropping TCP connections introduces excessive delays to 274 the resolution process. 276 Whether a server accepts TCP connections can be tested by first 277 checking that it responds to UDP queries to confirm that it is up and 278 operating, then attempting the same query over TCP. An additional 279 query should be made over UDP if the TCP connection attempt fails to 280 confirm that the server under test is still operating. 282 3.2. EDNS Queries 284 EDNS queries are specified in [RFC6891]. 286 3.2.1. EDNS Queries - Version Independent 288 Identifying servers that fail to respond to EDNS queries can be done 289 by first confirming that the server responds to regular DNS queries, 290 followed by a series of otherwise identical queries using EDNS, then 291 making the original query again. A series of EDNS queries is needed 292 as at least one DNS implementation responds to the first EDNS query 293 with FORMERR but fails to respond to subsequent queries from the same 294 address for a period until a regular DNS query is made. The EDNS 295 query should specify a UDP buffer size of 512 bytes to avoid false 296 classification of not supporting EDNS due to response packet size. 298 If the server responds to the first and last queries but fails to 299 respond to most or all of the EDNS queries, it is probably faulty. 300 The test should be repeated a number of times to eliminate the 301 likelihood of a false positive due to packet loss. 303 Firewalls may also block larger EDNS responses but there is no easy 304 way to check authoritative servers to see if the firewall is mis- 305 configured. 307 3.2.2. EDNS Queries - Version Specific 309 Some servers respond correctly to EDNS version 0 queries but fail to 310 respond to EDNS queries with version numbers that are higher than 311 zero. Servers should respond with BADVERS to EDNS queries with 312 version numbers that they do not support. 314 Some servers respond correctly to EDNS version 0 queries but fail to 315 set QR=1 when responding to EDNS versions they do not support. Such 316 answers are discarded or treated as requests. 318 3.2.3. EDNS Options 320 Some servers fail to respond to EDNS queries with EDNS options set. 321 Unknown EDNS options are supposed to be ignored by the server 322 [RFC6891], the original EDNS specification left this behaviour 323 undefined [RFC2671]. 325 3.2.4. EDNS Flags 327 Some servers fail to respond to EDNS queries with EDNS flags set. 328 Servers should ignore EDNS flags they do not understand and must not 329 add them to the response [RFC6891]. 331 3.2.5. Truncated EDNS Responses 333 Some EDNS aware servers fail to include an OPT record when a 334 truncated response is sent. An OPT record is supposed to be included 335 in a truncated response [RFC6891]. 337 Some EDNS aware server fail to honour the advertised EDNS buffer size 338 and send over-sized responses [RFC6891]. 340 3.2.6. DO=1 Handling 342 Some nameservers incorrectly only return an EDNS response when the DO 343 bit [RFC3225] is 1 in the query. Additionally some nameservers fail 344 to copy the DO bit to the response despite clearly supporting DNSSEC 345 by returning an RRSIG records to EDNS queries with DO=1. 347 3.2.7. EDNS over TCP 349 Some EDNS aware servers incorrectly limit the TCP response sizes to 350 the advertised UDP response size. 352 4. Firewalls and Load Balancers 354 Firewalls and load balancers can affect the externally visible 355 behaviour of a nameserver. Tests for conformance should to be done 356 from outside of any firewall so that the system is tested as a whole. 358 Firewalls and load balancers should not drop DNS packets that they 359 don't understand. They should either pass the packets or generate an 360 appropriate error response. 362 Requests for unknown query types are normal client behaviour and 363 should not be construed as an attack. Nameservers have always been 364 expected to be able to handle such queries. 366 Requests for unknown query classes are normal client behaviour and 367 should not be construed as an attack. Nameservers have always been 368 expected to be able to handle such queries. 370 Requests with unknown opcodes are normal client behaviour and should 371 not be construed as an attack. Nameservers have always been expected 372 to be able to handle such queries. 374 Requests with unassigned flags set (DNS or EDNS) are expected client 375 behaviour and should not be construed as an attack. The behaviour 376 for unassigned flags is to ignore them in the request and to not set 377 them in the response. Dropping DNS / EDNS packets with unassigned 378 flags makes it difficult to deploy extensions that make use of them 379 due to the need to reconfigure and update firewalls. 381 Requests with unknown EDNS options are expected client behaviour and 382 should not be construed as an attack. The correct behaviour for 383 unknown EDNS options is to ignore their presence when constructing a 384 reply. 386 Requests with unknown EDNS versions are expected client behaviour and 387 should not be construed as an attack. The correct behaviour for 388 unknown EDNS versions is to return BADVERS along with the highest 389 EDNS version the server supports. Dropping EDNS packets breaks EDNS 390 version negotiation. 392 Firewalls should not assume that there will only be a single response 393 message to a request. There have been proposals to use EDNS to 394 signal that multiple DNS messages be returned rather than a single 395 UDP message that is fragmented at the IP layer. 397 DNS, and EDNS in particular, are designed to allow clients to be able 398 to use new features against older servers without having to validate 399 every option. Indiscriminate blocking of messages breaks that 400 design. 402 However, there may be times when a nameserver mishandles messages 403 with a particular flag, EDNS option, EDNS version field, opcode, type 404 or class field or combination thereof to the point where the 405 integrity of the nameserver is compromised. Firewalls should offer 406 the ability to selectively reject messages using an appropriately 407 constructed response based on all these fields while awaiting a fix 408 from the nameserver vendor. 410 5. Scrubbing Services 412 Scrubbing services can affect the externally visible behaviour of a 413 nameserver in a similar way to firewalls. If a operator uses a 414 scrubbing service, they should check that legitimate queries are not 415 being blocked. 417 Scrubbing services, unlike firewalls, are also turned on and off in 418 response to denial of service attacks. One needs to take care when 419 choosing a scrubbing service. 421 Ideally, Operators should run these tests against a scrubbing service 422 to ensure that these tests are not seen as attack vectors. 424 6. Whole Answer Caches 426 Whole answer caches take a previously constructed answer and return 427 it to a subsequent query for the same question. However, they can 428 return the wrong response if they do not take all of the relevant 429 attributes of the query into account. 431 In addition to the standard tuple of a non- 432 exhaustive set of attributes that must be considered include: RD, AD, 433 CD, OPT record, DO, EDNS buffer size, EDNS version, EDNS options, and 434 transport. 436 7. Response Code Selection 438 Choosing the correct response code when responding to DNS queries is 439 important. Response codes should be chosen considering how clients 440 will handle them. 442 For unimplemented opcodes NOTIMP is the expected response code. For 443 example, a new opcode could change the message format by extending 444 the header or changing the structure of the records etc. 446 For unimplemented type codes, and in the absence of other errors, the 447 only valid response is NoError if the qname exists, and NameError 448 (NXDOMAIN) otherwise. For Meta-RRs NOTIMP may be returned instead. 450 If a zone cannot be loaded because it contains unimplemented type 451 codes that are not encoded as unknown record types according to 452 [RFC3597] then the expected response is SERVFAIL as the whole zone 453 should be rejected Section 5.2 [RFC1035]. If a zone loads then 454 Section 4.3.2 [RFC1034] applies. 456 If the server supports EDNS and receives a query with an unsupported 457 EDNS version, the correct response is BADVERS [RFC6891]. 459 If the server does not support EDNS at all, FORMERR is the expected 460 error code. That said a minimal EDNS server implementation requires 461 parsing the OPT records and responding with an empty OPT record in 462 the additional section in most cases. There is no need to interpret 463 any EDNS options present in the request as unsupported EDNS options 464 are expected to be ignored [RFC6891]. Additionally EDNS flags can be 465 ignored. The only part of the OPT record that needs to be examined 466 is the version field to determine if BADVERS needs to be sent or not. 468 8. Testing 470 Testing is divided into two sections. "Basic DNS", which all servers 471 should meet, and "Extended DNS", which should be met by all servers 472 that support EDNS (a server is deemed to support EDNS if it gives a 473 valid EDNS response to any EDNS query). If a server does not support 474 EDNS it should still respond to all the tests. 476 These tests query for records at the apex of a zone that the server 477 is nominally configured to serve. All tests should use the same 478 zone. 480 It is advisable to run all of the tests below in parallel so as to 481 minimise the delays due to multiple timeouts when the servers do not 482 respond. There are 16 queries directed to each nameserver (assuming 483 no packet loss) testing different aspects of Basic DNS and Extended 484 DNS. 486 The tests below use dig from BIND 9.11.0. 488 8.1. Testing - Basic DNS 490 This first set of tests cover basic DNS server behaviour and all 491 servers should pass these tests. 493 8.1.1. Is The Server Configured For The Zone? 495 Ask for the SOA record of the configured zone. This query is made 496 with no DNS flag bits set and without EDNS. 498 We expect the SOA record for the zone to be returned in the answer 499 section with the rcode set to NOERROR and the AA and QR bits to be 500 set in the response; RA may also be set [RFC1034]. We do not expect 501 an OPT record to be returned [RFC6891]. 503 Verify the server is configured for the zone: 505 dig +noedns +noad +norec soa $zone @$server 507 expect: status: NOERROR 508 expect: the SOA record to be present in the answer section 509 expect: flag: aa to be present 510 expect: flag: rd to NOT be present 511 expect: flag: ad to NOT be present 512 expect: the OPT record to NOT be present 514 8.1.2. Testing Unknown Types 516 Ask for the TYPE1000 RRset at the configured zone's name. This query 517 is made with no DNS flag bits set and without EDNS. TYPE1000 has 518 been chosen for this purpose as IANA is unlikely to allocate this 519 type in the near future and it is not in a range reserved for private 520 use [RFC6895]. Any unallocated type code could be chosen for this 521 test. 523 We expect no records to be returned in the answer section with the 524 rcode set to NOERROR and the AA and QR bits to be set in the 525 response; RA may also be set [RFC1034]. We do not expect an OPT 526 record to be returned [RFC6891]. 528 Check that queries for an unknown type work: 530 dig +noedns +noad +norec type1000 $zone @$server 532 expect: status: NOERROR 533 expect: an empty answer section. 534 expect: flag: aa to be present 535 expect: flag: rd to NOT be present 536 expect: flag: ad to NOT be present 537 expect: the OPT record to NOT be present 539 8.1.3. Testing Header Bits 541 8.1.3.1. Testing CD=1 Queries 543 Ask for the SOA record of the configured zone. This query is made 544 with only the CD DNS flag bit set, all other DNS bits clear, and 545 without EDNS. 547 We expect the SOA record for the zone to be returned in the answer 548 section with the rcode set to NOERROR and the AA and QR bits to be 549 set in the response. We do not expect an OPT record to be returned. 551 If the server supports DNSSEC, CD should be set in the response 552 [RFC4035] otherwise CD should be clear [RFC1034]. 554 Check that queries with CD=1 work: 556 dig +noedns +noad +norec +cd soa $zone @$server 558 expect: status: NOERROR 559 expect: the SOA record to be present in the answer section 560 expect: flag: aa to be present 561 expect: flag: rd to NOT be present 562 expect: flag: ad to NOT be present 563 expect: the OPT record to NOT be present 565 8.1.3.2. Testing AD=1 Queries 567 Ask for the SOA record of the configured zone. This query is made 568 with only the AD DNS flag bit set and all other DNS bits clear and 569 without EDNS. 571 We expect the SOA record for the zone to be returned in the answer 572 section with the rcode set to NOERROR and the AA and QR bits to be 573 set in the response. We do not expect an OPT record to be returned. 574 The purpose of this query is to detect blocking of queries with the 575 AD bit present, not the specific value of AD in the response. 577 Check that queries with AD=1 work: 579 dig +noedns +norec +ad soa $zone @$server 581 expect: status: NOERROR 582 expect: the SOA record to be present in the answer section 583 expect: flag: aa to be present 584 expect: flag: rd to NOT be present 585 expect: the OPT record to NOT be present 587 AD use in queries is defined in [RFC6840]. 589 8.1.3.3. Testing Reserved Bit 591 Ask for the SOA record of the configured zone. This query is made 592 with only the final reserved DNS flag bit set and all other DNS bits 593 clear and without EDNS. 595 We expect the SOA record for the zone to be returned in the answer 596 section with the rcode set to NOERROR and the AA and QR bits to be 597 set in the response; RA may be set. The final reserved bit must not 598 be set [RFC1034]. We do not expect an OPT record to be returned 599 [RFC6891]. 601 Check that queries with the last unassigned DNS header flag work and 602 that the flag bit is not copied to the response: 604 dig +noedns +noad +norec +zflag soa $zone @$server 606 expect: status: NOERROR 607 expect: the SOA record to be present in the answer section 608 expect: MBZ to NOT be in the response (see below) 609 expect: flag: aa to be present 610 expect: flag: rd to NOT be present 611 expect: flag: ad to NOT be present 612 expect: the OPT record to NOT be present 614 MBZ (Must Be Zero) is a dig-specific indication that the flag bit has 615 been incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved 616 for future use. Must be zero in all queries and responses." 618 8.1.3.4. Testing Recursive Queries 620 Ask for the SOA record of the configured zone. This query is made 621 with only the RD DNS flag bit set and without EDNS. 623 We expect the SOA record for the zone to be returned in the answer 624 section with the rcode set to NOERROR and the AA, QR and RD bits to 625 be set in the response; RA may also be set [RFC1034]. We do not 626 expect an OPT record to be returned [RFC6891]. 628 Check that recursive queries work: 630 dig +noedns +noad +rec soa $zone @$server 632 expect: status: NOERROR 633 expect: the SOA record to be present in the answer section 634 expect: flag: aa to be present 635 expect: flag: rd to be present 636 expect: flag: ad to NOT be present 637 expect: the OPT record to NOT be present 639 8.1.4. Testing Unknown Opcodes 641 Construct a DNS message that consists of only a DNS header with 642 opcode set to 15 (currently not allocated), no DNS header bits set 643 and empty question, answer, authority and additional sections. 645 Check that new opcodes are handled: 647 dig +noedns +noad +opcode=15 +norec +header-only @$server 649 expect: status: NOTIMP 650 expect: opcode: 15 651 expect: all sections to be empty 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 8.1.5. Testing TCP 659 Ask for the SOA record of the configured zone. This query is made 660 with no DNS flag bits set and without EDNS. This query is to be sent 661 using TCP. 663 We expect the SOA record for the zone to be returned in the answer 664 section with the rcode set to NOERROR and the AA and QR bits to be 665 set in the response; RA may also be set [RFC1034]. We do not expect 666 an OPT record to be returned [RFC6891]. 668 Check that TCP queries work: 670 dig +noedns +noad +norec +tcp soa $zone @$server 672 expect: status: NOERROR 673 expect: the SOA record to be present in the answer section 674 expect: flag: aa to be present 675 expect: flag: rd to NOT be present 676 expect: flag: ad to NOT be present 677 expect: the OPT record to NOT be present 679 The requirement that TCP be supported is defined in [RFC7766]. 681 8.2. Testing - Extended DNS 683 The next set of tests cover various aspects of EDNS behaviour. If 684 any of these tests succeed (indicating at least some EDNS support) 685 then all of them should succeed. There are servers that support EDNS 686 but fail to handle plain EDNS queries correctly so a plain EDNS query 687 is not a good indicator of lack of EDNS support. 689 8.2.1. Testing Minimal EDNS 691 Ask for the SOA record of the configured zone. This query is made 692 with no DNS flag bits set. EDNS version 0 is used without any EDNS 693 options or EDNS flags set. 695 We expect the SOA record for the zone to be returned in the answer 696 section with the rcode set to NOERROR and the AA and QR bits to be 697 set in the response; RA may also be set [RFC1034]. We expect an OPT 698 record to be returned. There should be no EDNS flags present in the 699 response. The EDNS version field should be 0 and there should be no 700 EDNS options present [RFC6891]. 702 Check that plain EDNS queries work: 704 dig +nocookie +edns=0 +noad +norec soa $zone @$server 706 expect: status: NOERROR 707 expect: the SOA record to be present in the answer section 708 expect: an OPT record to be present in the additional section 709 expect: EDNS Version 0 in response 710 expect: flag: aa to be present 711 expect: flag: ad to NOT be present 713 +nocookie disables sending a EDNS COOKIE option which is otherwise 714 enabled by default in BIND 9.11.0 (and later). 716 8.2.2. Testing EDNS Version Negotiation 718 Ask for the SOA record of a zone the server is nominally configured 719 to serve. This query is made with no DNS flag bits set. EDNS 720 version 1 is used without any EDNS options or EDNS flags set. 722 We expect the SOA record for the zone to NOT be returned in the 723 answer section with the extended rcode set to BADVERS and the QR bit 724 to be set in the response; RA may also be set [RFC1034]. We expect 725 an OPT record to be returned. There should be no EDNS flags present 726 in the response. The EDNS version field should be 0 in the response 727 as no other EDNS version has as yet been specified [RFC6891]. 729 Check that EDNS version 1 queries work (EDNS supported): 731 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 733 expect: status: BADVERS 734 expect: the SOA record to NOT be present in the answer section 735 expect: an OPT record to be present in the additional section 736 expect: EDNS Version 0 in response 737 expect: flag: aa to NOT be present 738 expect: flag: ad to NOT be present 740 +noednsneg has been set as dig supports EDNS version negotiation and 741 we want to see only the response to the initial EDNS version 1 query. 743 8.2.3. Testing Unknown EDNS Options 745 Ask for the SOA record of the configured zone. This query is made 746 with no DNS flag bits set. EDNS version 0 is used without any EDNS 747 flags. An EDNS option is present with a value that has not yet been 748 assigned by IANA. We have picked an unassigned code of 100 for the 749 example below. Any unassigned EDNS option code could have been 750 choose for this test. 752 We expect the SOA record for the zone to be returned in the answer 753 section with the rcode set to NOERROR and the AA and QR bits to be 754 set in the response; RA may also be set [RFC1034]. We expect an OPT 755 record to be returned. There should be no EDNS flags present in the 756 response. The EDNS version field should be 0 as EDNS versions other 757 than 0 are yet to be specified and there should be no EDNS options 758 present as unknown EDNS options are supposed to be ignored by the 759 server [RFC6891] Section 6.1.2. 761 Check that EDNS queries with an unknown option work (EDNS supported): 763 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 765 expect: status: NOERROR 766 expect: the SOA record to be present in the answer section 767 expect: an OPT record to be present in the additional section 768 expect: OPT=100 to NOT be present 769 expect: EDNS Version 0 in response 770 expect: flag: aa to be present 771 expect: flag: ad to NOT be present 773 8.2.4. Testing Unknown EDNS Flags 775 Ask for the SOA record of the configured zone. This query is made 776 with no DNS flag bits set. EDNS version 0 is used without any EDNS 777 options. An unassigned EDNS flag bit is set (0x40 in this case). 779 We expect the SOA record for the zone to be returned in the answer 780 section with the rcode set to NOERROR and the AA and QR bits to be 781 set in the response; RA may also be set [RFC1034]. We expect an OPT 782 record to be returned. There should be no EDNS flags present in the 783 response as unknown EDNS flags are supposed to be ignored. The EDNS 784 version field should be 0 and there should be no EDNS options present 785 [RFC6891]. 787 Check that EDNS queries with unknown flags work (EDNS supported): 789 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 791 expect: status: NOERROR 792 expect: the SOA record to be present in the answer section 793 expect: an OPT record to be present in the additional section 794 expect: MBZ not to be present 795 expect: EDNS Version 0 in response 796 expect: flag: aa to be present 797 expect: flag: ad to NOT be present 799 MBZ (Must Be Zero) is a dig-specific indication that a flag bit has 800 been incorrectly copied as per Section 6.1.4, [RFC6891]. 802 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 804 Ask for the SOA record of the configured zone. This query is made 805 with no DNS flag bits set. EDNS version 1 is used without any EDNS 806 options. An unassigned EDNS flag bit is set (0x40 in this case). 808 We expect the SOA record for the zone to NOT be returned in the 809 answer section with the extended rcode set to BADVERS and the QR bit 810 to be set in the response; RA may also be set [RFC1034]. We expect 811 an OPT record to be returned. There should be no EDNS flags present 812 in the response as unknown EDNS flags are supposed to be ignored. 813 The EDNS version field should be 0 as EDNS versions other than 0 are 814 yet to be specified and there should be no EDNS options present 815 [RFC6891]. 817 Check that EDNS version 1 queries with unknown flags work (EDNS 818 supported): 820 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 821 $zone @$server 823 expect: status: BADVERS 824 expect: SOA record to NOT be present 825 expect: an OPT record to be present in the additional section 826 expect: MBZ not to be present 827 expect: EDNS Version 0 in response 828 expect: flag: aa to NOT be present 829 expect: flag: ad to NOT be present 831 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 833 Ask for the SOA record of the configured zone. This query is made 834 with no DNS flag bits set. EDNS version 1 is used. An unknown EDNS 835 option is present. We have picked an unassigned code of 100 for the 836 example below. Any unassigned EDNS option code could have been 837 chosen for this test. 839 We expect the SOA record for the zone to NOT be returned in the 840 answer section with the extended rcode set to BADVERS and the QR bit 841 to be set in the response; RA may also be set [RFC1034]. We expect 842 an OPT record to be returned. There should be no EDNS flags present 843 in the response. The EDNS version field should be 0 as EDNS versions 844 other than 0 are yet to be specified and there should be no EDNS 845 options present [RFC6891]. 847 Check that EDNS version 1 queries with unknown options work (EDNS 848 supported): 850 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 851 $zone @$server 853 expect: status: BADVERS 854 expect: SOA record to NOT be present 855 expect: an OPT record to be present in the additional section 856 expect: OPT=100 to NOT be present 857 expect: EDNS Version 0 in response 858 expect: flag: aa to NOT be present 859 expect: flag: ad to NOT be present 861 8.2.7. Testing Truncated Responses 863 Ask for the DNSKEY records of the configured zone, which must be a 864 DNSSEC signed zone. This query is made with no DNS flag bits set. 865 EDNS version 0 is used without any EDNS options. The only EDNS flag 866 set is DO. The EDNS UDP buffer size is set to 512. The intention of 867 this query is to elicit a truncated response from the server. Most 868 signed DNSKEY responses are bigger than 512 bytes. This test will 869 not give a valid result if the zone is not signed. 871 We expect a response with the rcode set to NOERROR and the AA and QR 872 bits to be set, AD may be set in the response if the server supports 873 DNSSEC otherwise it should be clear; TC and RA may also be set 874 [RFC1035] [RFC4035]. We expect an OPT record to be present in the 875 response. There should be no EDNS flags other than DO present in the 876 response. The EDNS version field should be 0 and there should be no 877 EDNS options present [RFC6891]. 879 If TC is not set it is not possible to confirm that the server 880 correctly adds the OPT record to the truncated responses or not. 882 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 883 expect: NOERROR 884 expect: OPT record with version set to 0 886 8.2.8. Testing DO=1 Handling 888 Ask for the SOA record of the configured zone, which does not need to 889 be DNSSEC signed. This query is made with no DNS flag bits set. 890 EDNS version 0 is used without any EDNS options. The only EDNS flag 891 set is DO. 893 We expect the SOA record for the zone to be returned in the answer 894 section with the rcode set to NOERROR and the AA and QR bits to be 895 set in the response, AD may be set in the response if the server 896 supports DNSSEC otherwise it should be clear; RA may also be set 897 [RFC1034]. We expect an OPT record to be returned. There should be 898 no EDNS flags other than DO present in the response which should be 899 present if the server supports DNSSEC. The EDNS version field should 900 be 0 and there should be no EDNS options present [RFC6891]. 902 Check that DO=1 queries work (EDNS supported): 904 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 906 expect: status: NOERROR 907 expect: the SOA record to be present in the answer section 908 expect: an OPT record to be present in the additional section 909 expect: DO=1 to be present if a RRSIG is in the response 910 expect: EDNS Version 0 in response 911 expect: flag: aa to be present 913 8.2.9. Testing EDNS Version Negotiation With DO=1 915 Ask for the SOA record of the configured zone, which does not need to 916 be DNSSEC signed. This query is made with no DNS flag bits set. 917 EDNS version 1 is used without any EDNS options. The only EDNS flag 918 set is DO. 920 We expect the SOA record for the zone to NOT be returned in the 921 answer section with the rcode set to BADVERS; the QR bit and possibly 922 the RA bit to be set [RFC1034]. We expect an OPT record to be 923 returned. There should be no EDNS flags other than DO present in the 924 response which should be there if the server supports DNSSEC. The 925 EDNS version field should be 0 and there should be no EDNS options 926 present [RFC6891]. 928 Check that EDNS version 1, DO=1 queries work (EDNS supported): 930 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 931 $zone @$server 933 expect: status: BADVERS 934 expect: SOA record to NOT be present 935 expect: an OPT record to be present in the additional section 936 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 937 returned DO=1 938 expect: EDNS Version 0 in response 939 expect: flag: aa to NOT be present 941 8.2.10. Testing With Multiple Defined EDNS Options 943 Ask for the SOA record of the configured zone. This query is made 944 with no DNS flag bits set. EDNS version 0 is used. A number of 945 defined EDNS options are present (NSID [RFC5001], DNS COOKIE 946 [RFC7873], EDNS Client Subnet [RFC7871] and EDNS Expire [RFC7314]). 948 We expect the SOA record for the zone to be returned in the answer 949 section with the rcode set to NOERROR and the AA and QR bits to be 950 set in the response; RA may also be set [RFC1034]. We expect an OPT 951 record to be returned. There should be no EDNS flags present in the 952 response. The EDNS version field should be 0. Any of the requested 953 EDNS options supported by the server and permitted server 954 configuration may be returned [RFC6891]. 956 Check that EDNS queries with multiple defined EDNS options work: 958 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 959 soa $zone @$server 961 expect: status: NOERROR 962 expect: the SOA record to be present in the answer section 963 expect: an OPT record to be present in the additional section 964 expect: EDNS Version 0 in response 965 expect: flag: aa to be present 966 expect: flag: ad to NOT be present 968 8.3. When EDNS Is Not Supported 970 If EDNS is not supported by the nameserver, we expect a response to 971 each of the above queries. That response may be a FORMERR error 972 response or the OPT record may just be ignored. 974 Some nameservers only return a EDNS response when a particular EDNS 975 option or flag (e.g. DO=1) is present in the request. This 976 behaviour is not compliant behaviour and may hide other incorrect 977 behaviour from the above tests. Re-testing with the triggering 978 option / flag present will expose this misbehaviour. 980 9. Remediation 982 Name server operators are generally expected to test their own 983 infrastructure for compliance to standards. The above tests should 984 be run when new systems are brought online, and should be repeated 985 periodically to ensure continued interoperability. 987 Domain registrants who do not maintain their own DNS infrastructure 988 are entitled to a DNS service that conforms to standards and 989 interoperates well. Registrants who become aware that their DNS 990 operator does not have a well maintained or compliant infrastructure 991 should insist that their service provider correct issues, and switch 992 providers if they do not. 994 In the event that an operator experiences problems due to the 995 behaviour of name servers outside their control, the above tests will 996 help in narrowing down the precise issue(s) which can then be 997 reported to the relevant party. 999 If contact information for the operator of a misbehaving name server 1000 is not already known, the following methods of communication could be 1001 considered: 1003 o the RNAME of the zone authoritative for the name of the 1004 misbehaving server 1006 o the RNAME of zones for which the offending server is authoritative 1008 o administrative or technical contacts listed in the registration 1009 information for the parent domain of the name of the misbehaving 1010 server, or for zones for which the name server is authoritative 1012 o the registrar or registry for such zones 1014 o DNS-specific operational fora (e.g. mailing lists) 1016 Operators of parent zones may wish to regularly test the 1017 authoritative name servers of their child zones. However, parent 1018 operators can have widely varying capabilities in terms of 1019 notification or remediation depending on whether they have a direct 1020 relationship with the child operator. Many TLD registries, for 1021 example, cannot directly contact their registrants and may instead 1022 need to communicate through the relevant registrar. In such cases 1023 it may be most efficient for registrars to take on the responsibility 1024 for testing the name servers of their registrants, since they have a 1025 direct relationship. 1027 When notification is not effective at correcting problems with a 1028 misbehaving name server, parent operators can choose to remove NS 1029 record sets (and glue records below) that refer to the faulty server 1030 until the servers are fixed. This should only be done as a last 1031 resort and with due consideration, as removal of a delegation can 1032 have unanticipated side effects. For example, other parts of the DNS 1033 tree may depend on names below the removed zone cut, and the parent 1034 operator may find themselves responsible for causing new DNS failures 1035 to occur. 1037 10. Security Considerations 1039 Testing protocol compliance can potentially result in false reports 1040 of attempts to break services from Intrusion Detection Services and 1041 firewalls. All of the tests are well-formed (though not necessarily 1042 common) DNS queries. None the tests listed above should cause any 1043 harm to a protocol-compliant server. 1045 Relaxing firewall settings to ensure EDNS compliance could 1046 potentially expose a critical implementation flaw in the nameserver. 1048 Nameservers should be tested for conformance before relaxing firewall 1049 settings. 1051 When removing delegations for non-compliant servers there can be a 1052 knock on effect on other zones that require these zones to be 1053 operational for the nameservers addresses to be resolved. 1055 11. IANA Considerations 1057 There are no actions for IANA. 1059 12. References 1061 12.1. Normative References 1063 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1064 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1065 . 1067 [RFC1035] Mockapetris, P., "Domain names - implementation and 1068 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1069 November 1987, . 1071 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1072 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1073 . 1075 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1076 Rose, "Protocol Modifications for the DNS Security 1077 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1078 . 1080 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1081 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1082 DOI 10.17487/RFC6840, February 2013, 1083 . 1085 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1086 for DNS (EDNS(0))", STD 75, RFC 6891, 1087 DOI 10.17487/RFC6891, April 2013, 1088 . 1090 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1091 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1092 April 2013, . 1094 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1095 D. Wessels, "DNS Transport over TCP - Implementation 1096 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1097 . 1099 12.2. Informative References 1101 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1102 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1103 . 1105 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record 1106 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 1107 2003, . 1109 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1110 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1111 . 1113 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1114 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1115 . 1117 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1118 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1119 DOI 10.17487/RFC7871, May 2016, 1120 . 1122 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1123 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1124 . 1126 Authors' Addresses 1128 M. Andrews 1129 Internet Systems Consortium 1130 950 Charter Street 1131 Redwood City, CA 94063 1132 US 1134 Email: marka@isc.org 1135 Ray Bellis 1136 Internet Systems Consortium 1137 950 Charter Street 1138 Redwood City, CA 94063 1139 US 1141 Email: ray@isc.org