idnits 2.17.1 draft-ietf-dnsop-no-response-issue-16.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 1038 has weird spacing: '...r zones for ...' -- The document date (March 8, 2020) is 1511 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-16 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 . . . . . . . . . . . . . . . . . 13 84 8.1.4. Testing Unknown Opcodes . . . . . . . . . . . . . . . 15 85 8.1.5. Testing TCP . . . . . . . . . . . . . . . . . . . . . 15 86 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 16 87 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 16 88 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 17 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 . . . . . 22 99 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 22 100 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 22 101 10. Security Considerations . . . . . . . . . . . . . . . . . . . 24 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 recognise, or 235 doesn't implement, it is expected to return the appropriate response 236 as if it did recognise 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 Servers should respond to such queries. If the server does not know 249 the meaning of a flag bit it must not copy it to the response 250 [RFC1035] Section 4.1.1. If the server does not understand the 251 meaning of a request it should reply with a FORMERR response with 252 unknown flags set to zero. 254 3.1.3.1. Recursive Queries 256 A non-recursive server is supposed to respond to recursive queries as 257 if the RD bit is not set [RFC1034]. 259 3.1.4. Unknown DNS opcodes 261 The use of previously undefined opcodes is to be expected. Since the 262 DNS was first defined two new opcodes have been added, UPDATE and 263 NOTIFY. 265 NOTIMP is the expected rcode to an unknown or unimplemented opcode. 267 Note: while new opcodes will most probably use the current layout 268 structure for the rest of the message there is no requirement that 269 anything other than the DNS header match. 271 3.1.5. TCP Queries 273 All DNS servers are supposed to respond to queries over TCP 274 [RFC7766]. While firewalls should not block TCP connection attempts 275 if they do they should cleanly terminate the connection by sending 276 TCP RESET or sending ICMP/ICMPv6 Administratively Prohibited 277 messages. Dropping TCP connections introduces excessive delays to 278 the resolution process. 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 responses may be discarded as invalid (as QR is not 1) or 315 treated as requests (when the source port of the original request was 316 port 53). 318 3.2.3. EDNS Options 320 Some servers fail to respond to EDNS queries with EDNS options set. 321 The original EDNS specification left this behaviour undefined 322 [RFC2671], but the correct behaviour was clarified in [RFC6891]. 323 Unknown EDNS options are supposed to be ignored by the server. 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 servers fail to honour the advertised EDNS UDP buffer 338 size and send over-sized responses [RFC6891]. Servers must send UDP 339 responses no larger than the advertised EDNS UDP buffer size. 341 3.2.6. DO=1 Handling 343 Some nameservers incorrectly only return an EDNS response when the DO 344 bit [RFC3225] is 1 in the query. Servers that support EDNS should 345 always respond to EDNS requests with EDNS responses. 347 Some nameservers fail to copy the DO bit to the response despite 348 clearly supporting DNSSEC by returning an RRSIG records to EDNS 349 queries with DO=1. 351 3.2.7. EDNS over TCP 353 Some EDNS aware servers incorrectly limit the TCP response sizes to 354 the advertised UDP response size. This breaks DNS resolution to 355 clients where the response sizes exceed the advertised UDP response 356 size despite the server and the client being capable of sending and 357 receiving larger TCP responses respectively. It effectively defeats 358 setting TC=1 in UDP responses. 360 4. Firewalls and Load Balancers 362 Firewalls and load balancers can affect the externally visible 363 behaviour of a nameserver. Tests for conformance should to be done 364 from outside of any firewall so that the system is tested as a whole. 366 Firewalls and load balancers should not drop DNS packets that they 367 don't understand. They should either pass the packets or generate an 368 appropriate error response. 370 Requests for unknown query types are normal client behaviour and 371 should not be construed as an attack. Nameservers have always been 372 expected to be able to handle such queries. 374 Requests for unknown query classes are normal client behaviour and 375 should not be construed as an attack. Nameservers have always been 376 expected to be able to handle such queries. 378 Requests with unknown opcodes are normal client behaviour and should 379 not be construed as an attack. Nameservers have always been expected 380 to be able to handle such queries. 382 Requests with unassigned flags set (DNS or EDNS) are expected client 383 behaviour and should not be construed as an attack. The behaviour 384 for unassigned flags is to ignore them in the request and to not set 385 them in the response. Dropping DNS / EDNS packets with unassigned 386 flags makes it difficult to deploy extensions that make use of them 387 due to the need to reconfigure and update firewalls. 389 Requests with unknown EDNS options are expected client behaviour and 390 should not be construed as an attack. The correct behaviour for 391 unknown EDNS options is to ignore their presence when constructing a 392 reply. 394 Requests with unknown EDNS versions are expected client behaviour and 395 should not be construed as an attack. The correct behaviour for 396 unknown EDNS versions is to return BADVERS along with the highest 397 EDNS version the server supports. Dropping EDNS packets breaks EDNS 398 version negotiation. 400 Firewalls should not assume that there will only be a single response 401 message to a request. There have been proposals to use EDNS to 402 signal that multiple DNS messages be returned rather than a single 403 UDP message that is fragmented at the IP layer. 405 DNS, and EDNS in particular, are designed to allow clients to be able 406 to use new features against older servers without having to validate 407 every option. Indiscriminate blocking of messages breaks that 408 design. 410 However, there may be times when a nameserver mishandles messages 411 with a particular flag, EDNS option, EDNS version field, opcode, type 412 or class field or combination thereof to the point where the 413 integrity of the nameserver is compromised. Firewalls should offer 414 the ability to selectively reject messages using an appropriately 415 constructed response based on all these fields while awaiting a fix 416 from the nameserver vendor. 418 5. Scrubbing Services 420 Scrubbing services can affect the externally visible behaviour of a 421 nameserver in a similar way to firewalls. If an operator uses a 422 scrubbing service, they should check that legitimate queries are not 423 being blocked. 425 Scrubbing services, unlike firewalls, are also turned on and off in 426 response to denial of service attacks. One needs to take care when 427 choosing a scrubbing service. 429 Ideally, Operators should run these tests against a scrubbing service 430 to ensure that these tests are not seen as attack vectors. 432 6. Whole Answer Caches 434 Whole answer caches take a previously constructed answer and return 435 it to a subsequent query for the same question. However, they can 436 return the wrong response if they do not take all of the relevant 437 attributes of the query into account. 439 In addition to the standard tuple of a non- 440 exhaustive set of attributes that must be considered include: RD, AD, 441 CD, OPT record, DO, EDNS buffer size, EDNS version, EDNS options, and 442 transport. 444 7. Response Code Selection 446 Choosing the correct response code when responding to DNS queries is 447 important. Response codes should be chosen considering how clients 448 will handle them. 450 For unimplemented opcodes NOTIMP is the expected response code. 451 Note: Newly implemented opcodes may change the message format by 452 extending the header, changing the structure of the records, etc. 453 Servers are not expected to be able to parse these, and should 454 respond with a response code of NOTIMP rather than FORMERR (which 455 would be expected if there was a parse error with an known opcode). 457 For unimplemented type codes, and in the absence of other errors, the 458 only valid response is NoError if the qname exists, and NameError 459 (NXDOMAIN) otherwise. For Meta-RRs NOTIMP may be returned instead. 461 If a zone cannot be loaded because it contains unimplemented type 462 codes that are not encoded as unknown record types according to 463 [RFC3597] then the expected response is SERVFAIL as the whole zone 464 should be rejected Section 5.2 [RFC1035]. If a zone loads then 465 Section 4.3.2 [RFC1034] applies. 467 If the server supports EDNS and receives a query with an unsupported 468 EDNS version, the correct response is BADVERS [RFC6891]. 470 If the server does not support EDNS at all, FORMERR is the expected 471 error code. That said a minimal EDNS server implementation requires 472 parsing the OPT records and responding with an empty OPT record in 473 the additional section in most cases. There is no need to interpret 474 any EDNS options present in the request as unsupported EDNS options 475 are expected to be ignored [RFC6891]. Additionally EDNS flags can be 476 ignored. The only part of the OPT record that needs to be examined 477 is the version field to determine if BADVERS needs to be sent or not. 479 8. Testing 481 Testing is divided into two sections. "Basic DNS", which all servers 482 should meet, and "Extended DNS", which should be met by all servers 483 that support EDNS (a server is deemed to support EDNS if it gives a 484 valid EDNS response to any EDNS query). If a server does not support 485 EDNS it should still respond to all the tests. 487 These tests query for records at the apex of a zone that the server 488 is nominally configured to serve. All tests should use the same 489 zone. 491 It is advisable to run all of the tests below in parallel so as to 492 minimise the delays due to multiple timeouts when the servers do not 493 respond. There are 16 queries directed to each nameserver (assuming 494 no packet loss) testing different aspects of Basic DNS and Extended 495 DNS. 497 The tests below use dig from BIND 9.11.0. 499 8.1. Testing - Basic DNS 501 This first set of tests cover basic DNS server behaviour and all 502 servers should pass these tests. 504 8.1.1. Is The Server Configured For The Zone? 506 Ask for the SOA record of the configured zone. This query is made 507 with no DNS flag bits set and without EDNS. 509 We expect the SOA record for the zone to be returned in the answer 510 section, the rcode to be set to NOERROR, and the AA and QR bits to be 511 set in the header; RA may also be set [RFC1034]. We do not expect an 512 OPT record to be returned [RFC6891]. 514 Verify the server is configured for the zone: 516 dig +noedns +noad +norec soa $zone @$server 518 expect: status: NOERROR 519 expect: the SOA record to be present in the answer section 520 expect: flag: aa to be present 521 expect: flag: rd to NOT be present 522 expect: flag: ad to NOT be present 523 expect: the OPT record to NOT be present 525 8.1.2. Testing Unknown Types 527 Identifying servers that fail to respond to unknown or unsupported 528 types can be done by making an initial DNS query for an A record, 529 making a number of queries for an unallocated type, then making a 530 query for an A record again. IANA maintains a registry of allocated 531 types. 533 If the server responds to the first and last queries but fails to 534 respond to the queries for the unallocated type, it is probably 535 faulty. The test should be repeated a number of times to eliminate 536 the likelihood of a false positive due to packet loss. 538 Ask for the TYPE1000 RRset at the configured zone's name. This query 539 is made with no DNS flag bits set and without EDNS. TYPE1000 has 540 been chosen for this purpose as IANA is unlikely to allocate this 541 type in the near future and it is not in a range reserved for private 542 use [RFC6895]. Any unallocated type code could be chosen for this 543 test. 545 We expect no records to be returned in the answer section, the rcode 546 to be set to NOERROR, and the AA and QR bits to be set in the header; 547 RA may also be set [RFC1034]. We do not expect an OPT record to be 548 returned [RFC6891]. 550 Check that queries for an unknown type work: 552 dig +noedns +noad +norec type1000 $zone @$server 554 expect: status: NOERROR 555 expect: an empty answer section. 556 expect: flag: aa to be present 557 expect: flag: rd to NOT be present 558 expect: flag: ad to NOT be present 559 expect: the OPT record to NOT be present 561 8.1.3. Testing Header Bits 563 8.1.3.1. Testing CD=1 Queries 565 Ask for the SOA record of the configured zone. This query is made 566 with only the CD DNS flag bit set, all other DNS bits clear, and 567 without EDNS. 569 We expect the SOA record for the zone to be returned in the answer 570 section, the rcode to be set to NOERROR, and the AA and QR bits to be 571 set in the header. We do not expect an OPT record to be returned. 573 If the server supports DNSSEC, CD should be set in the response 574 [RFC4035] otherwise CD should be clear [RFC1034]. 576 Check that queries with CD=1 work: 578 dig +noedns +noad +norec +cd soa $zone @$server 580 expect: status: NOERROR 581 expect: the SOA record to be present in the answer section 582 expect: flag: aa to be present 583 expect: flag: rd to NOT be present 584 expect: flag: ad to NOT be present 585 expect: the OPT record to NOT be present 587 8.1.3.2. Testing AD=1 Queries 589 Ask for the SOA record of the configured zone. This query is made 590 with only the AD DNS flag bit set and all other DNS bits clear and 591 without EDNS. 593 We expect the SOA record for the zone to be returned in the answer 594 section, the rcode to be set to NOERROR, and the AA and QR bits to be 595 set in the header. We do not expect an OPT record to be returned. 596 The purpose of this query is to detect blocking of queries with the 597 AD bit present, not the specific value of AD in the response. 599 Check that queries with AD=1 work: 601 dig +noedns +norec +ad soa $zone @$server 603 expect: status: NOERROR 604 expect: the SOA record to be present in the answer section 605 expect: flag: aa to be present 606 expect: flag: rd to NOT be present 607 expect: the OPT record to NOT be present 609 AD use in queries is defined in [RFC6840]. 611 8.1.3.3. Testing Reserved Bit 613 Ask for the SOA record of the configured zone. This query is made 614 with only the final reserved DNS flag bit set and all other DNS bits 615 clear and without EDNS. 617 We expect the SOA record for the zone to be returned in the answer 618 section, the rcode to be set to NOERROR, and the AA and QR bits to be 619 set in the header; RA may be set. The final reserved bit must not be 620 set [RFC1034]. We do not expect an OPT record to be returned 621 [RFC6891]. 623 Check that queries with the last unassigned DNS header flag work and 624 that the flag bit is not copied to the response: 626 dig +noedns +noad +norec +zflag soa $zone @$server 628 expect: status: NOERROR 629 expect: the SOA record to be present in the answer section 630 expect: MBZ to NOT be in the response (see below) 631 expect: flag: aa to be present 632 expect: flag: rd to NOT be present 633 expect: flag: ad to NOT be present 634 expect: the OPT record to NOT be present 636 MBZ (Must Be Zero) is a dig-specific indication that the flag bit has 637 been incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved 638 for future use. Must be zero in all queries and responses." 640 8.1.3.4. Testing Recursive Queries 642 Ask for the SOA record of the configured zone. This query is made 643 with only the RD DNS flag bit set and without EDNS. 645 We expect the SOA record for the zone to be returned in the answer 646 section, the rcode to be set to NOERROR, and the AA, QR and RD bits 647 to be set in the header; RA may also be set [RFC1034]. We do not 648 expect an OPT record to be returned [RFC6891]. 650 Check that recursive queries work: 652 dig +noedns +noad +rec soa $zone @$server 654 expect: status: NOERROR 655 expect: the SOA record to be present in the answer section 656 expect: flag: aa to be present 657 expect: flag: rd to be present 658 expect: flag: ad to NOT be present 659 expect: the OPT record to NOT be present 661 8.1.4. Testing Unknown Opcodes 663 Construct a DNS message that consists of only a DNS header with 664 opcode set to 15 (currently not allocated), no DNS header bits set 665 and empty question, answer, authority and additional sections. 667 Check that new opcodes are handled: 669 dig +noedns +noad +opcode=15 +norec +header-only @$server 671 expect: status: NOTIMP 672 expect: opcode: 15 673 expect: all sections to be empty 674 expect: flag: aa to NOT 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 8.1.5. Testing TCP 681 Whether a server accepts TCP connections can be tested by first 682 checking that it responds to UDP queries to confirm that it is up and 683 operating, then attempting the same query over TCP. An additional 684 query should be made over UDP if the TCP connection attempt fails to 685 confirm that the server under test is still operating. 687 Ask for the SOA record of the configured zone. This query is made 688 with no DNS flag bits set and without EDNS. This query is to be sent 689 using TCP. 691 We expect the SOA record for the zone to be returned in the answer 692 section, the rcode to be set to NOERROR, and the AA and QR bits to be 693 set in the header; RA may also be set [RFC1034]. We do not expect an 694 OPT record to be returned [RFC6891]. 696 Check that TCP queries work: 698 dig +noedns +noad +norec +tcp soa $zone @$server 700 expect: status: NOERROR 701 expect: the SOA record to be present in the answer section 702 expect: flag: aa to be present 703 expect: flag: rd to NOT be present 704 expect: flag: ad to NOT be present 705 expect: the OPT record to NOT be present 707 The requirement that TCP be supported is defined in [RFC7766]. 709 8.2. Testing - Extended DNS 711 The next set of tests cover various aspects of EDNS behaviour. If 712 any of these tests succeed (indicating at least some EDNS support) 713 then all of them should succeed. There are servers that support EDNS 714 but fail to handle plain EDNS queries correctly so a plain EDNS query 715 is not a good indicator of lack of EDNS support. 717 8.2.1. Testing Minimal EDNS 719 Ask for the SOA record of the configured zone. This query is made 720 with no DNS flag bits set. EDNS version 0 is used without any EDNS 721 options or EDNS flags set. 723 We expect the SOA record for the zone to be returned in the answer 724 section, the rcode to be set to NOERROR, and the AA and QR bits to be 725 set in the header; RA may also be set [RFC1034]. We expect an OPT 726 record to be returned. There should be no EDNS flags present in the 727 response. The EDNS version field should be 0 and there should be no 728 EDNS options present [RFC6891]. 730 Check that plain EDNS queries work: 732 dig +nocookie +edns=0 +noad +norec soa $zone @$server 734 expect: status: NOERROR 735 expect: the SOA record to be present in the answer section 736 expect: an OPT record to be present in the additional section 737 expect: EDNS Version 0 in response 738 expect: flag: aa to be present 739 expect: flag: ad to NOT be present 741 +nocookie disables sending a EDNS COOKIE option which is otherwise 742 enabled by default in BIND 9.11.0 (and later). 744 8.2.2. Testing EDNS Version Negotiation 746 Ask for the SOA record of a zone the server is nominally configured 747 to serve. This query is made with no DNS flag bits set. EDNS 748 version 1 is used without any EDNS options or EDNS flags set. 750 We expect the SOA record for the zone to NOT be returned in the 751 answer section with the extended rcode set to BADVERS and the QR bit 752 to be set in the header; RA may also be set [RFC1034]. We expect an 753 OPT record to be returned. There should be no EDNS flags present in 754 the response. The EDNS version field should be 0 in the response as 755 no other EDNS version has as yet been specified [RFC6891]. 757 Check that EDNS version 1 queries work (EDNS supported): 759 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 761 expect: status: BADVERS 762 expect: the SOA record to NOT be present in the answer section 763 expect: an OPT record to be present in the additional section 764 expect: EDNS Version 0 in response 765 expect: flag: aa to NOT be present 766 expect: flag: ad to NOT be present 768 +noednsneg has been set as dig supports EDNS version negotiation and 769 we want to see only the response to the initial EDNS version 1 query. 771 8.2.3. Testing Unknown EDNS Options 773 Ask for the SOA record of the configured zone. This query is made 774 with no DNS flag bits set. EDNS version 0 is used without any EDNS 775 flags. An EDNS option is present with a value that has not yet been 776 assigned by IANA. We have picked an unassigned code of 100 for the 777 example below. Any unassigned EDNS option code could have been 778 choosen for this test. 780 We expect the SOA record for the zone to be returned in the answer 781 section, the rcode to be set to NOERROR, and the AA and QR bits to be 782 set in the header; RA may also be set [RFC1034]. We expect an OPT 783 record to be returned. There should be no EDNS flags present in the 784 response. The EDNS version field should be 0 as EDNS versions other 785 than 0 are yet to be specified and there should be no EDNS options 786 present as unknown EDNS options are supposed to be ignored by the 787 server [RFC6891] Section 6.1.2. 789 Check that EDNS queries with an unknown option work (EDNS supported): 791 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 793 expect: status: NOERROR 794 expect: the SOA record to be present in the answer section 795 expect: an OPT record to be present in the additional section 796 expect: OPT=100 to NOT be present 797 expect: EDNS Version 0 in response 798 expect: flag: aa to be present 799 expect: flag: ad to NOT be present 801 8.2.4. Testing Unknown EDNS Flags 803 Ask for the SOA record of the configured zone. This query is made 804 with no DNS flag bits set. EDNS version 0 is used without any EDNS 805 options. An unassigned EDNS flag bit is set (0x40 in this case). 807 We expect the SOA record for the zone to be returned in the answer 808 section, the rcode to be set to NOERROR, and the AA and QR bits to be 809 set in the header; RA may also be set [RFC1034]. We expect an OPT 810 record to be returned. There should be no EDNS flags present in the 811 response as unknown EDNS flags are supposed to be ignored. The EDNS 812 version field should be 0 and there should be no EDNS options present 813 [RFC6891]. 815 Check that EDNS queries with unknown flags work (EDNS supported): 817 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 819 expect: status: NOERROR 820 expect: the SOA record to be present in the answer section 821 expect: an OPT record to be present in the additional section 822 expect: MBZ not to be present 823 expect: EDNS Version 0 in response 824 expect: flag: aa to be present 825 expect: flag: ad to NOT be present 827 MBZ (Must Be Zero) is a dig-specific indication that a flag bit has 828 been incorrectly copied as per Section 6.1.4, [RFC6891]. 830 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 832 Ask for the SOA record of the configured zone. This query is made 833 with no DNS flag bits set. EDNS version 1 is used without any EDNS 834 options. An unassigned EDNS flag bit is set (0x40 in this case). 836 We expect the SOA record for the zone to NOT be returned in the 837 answer section with the extended rcode set to BADVERS and the QR bit 838 to be set in the header; RA may also be set [RFC1034]. We expect an 839 OPT record to be returned. There should be no EDNS flags present in 840 the response as unknown EDNS flags are supposed to be ignored. The 841 EDNS version field should be 0 as EDNS versions other than 0 are yet 842 to be specified and there should be no EDNS options present 843 [RFC6891]. 845 Check that EDNS version 1 queries with unknown flags work (EDNS 846 supported): 848 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 849 $zone @$server 851 expect: status: BADVERS 852 expect: SOA record to NOT be present 853 expect: an OPT record to be present in the additional section 854 expect: MBZ not to be present 855 expect: EDNS Version 0 in response 856 expect: flag: aa to NOT be present 857 expect: flag: ad to NOT be present 859 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 861 Ask for the SOA record of the configured zone. This query is made 862 with no DNS flag bits set. EDNS version 1 is used. An unknown EDNS 863 option is present. We have picked an unassigned code of 100 for the 864 example below. Any unassigned EDNS option code could have been 865 chosen for this test. 867 We expect the SOA record for the zone to NOT be returned in the 868 answer section with the extended rcode set to BADVERS and the QR bit 869 to be set in the header; RA may also be set [RFC1034]. We expect an 870 OPT record to be returned. There should be no EDNS flags present in 871 the response. The EDNS version field should be 0 as EDNS versions 872 other than 0 are yet to be specified and there should be no EDNS 873 options present [RFC6891]. 875 Check that EDNS version 1 queries with unknown options work (EDNS 876 supported): 878 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 879 $zone @$server 881 expect: status: BADVERS 882 expect: SOA record to NOT be present 883 expect: an OPT record to be present in the additional section 884 expect: OPT=100 to NOT be present 885 expect: EDNS Version 0 in response 886 expect: flag: aa to NOT be present 887 expect: flag: ad to NOT be present 889 8.2.7. Testing Truncated Responses 891 Ask for the DNSKEY records of the configured zone, which must be a 892 DNSSEC signed zone. This query is made with no DNS flag bits set. 893 EDNS version 0 is used without any EDNS options. The only EDNS flag 894 set is DO. The EDNS UDP buffer size is set to 512. The intention of 895 this query is to elicit a truncated response from the server. Most 896 signed DNSKEY responses are bigger than 512 bytes. This test will 897 not give a valid result if the zone is not signed. 899 We expect a response, the rcode to be set to NOERROR, and the AA and 900 QR bits to be set, AD may be set in the response if the server 901 supports DNSSEC otherwise it should be clear; TC and RA may also be 902 set [RFC1035] [RFC4035]. We expect an OPT record to be present in 903 the response. There should be no EDNS flags other than DO present in 904 the response. The EDNS version field should be 0 and there should be 905 no EDNS options present [RFC6891]. 907 If TC is not set it is not possible to confirm that the server 908 correctly adds the OPT record to the truncated responses or not. 910 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 911 expect: NOERROR 912 expect: OPT record with version set to 0 914 8.2.8. Testing DO=1 Handling 916 Ask for the SOA record of the configured zone, which does not need to 917 be DNSSEC signed. This query is made with no DNS flag bits set. 918 EDNS version 0 is used without any EDNS options. The only EDNS flag 919 set is DO. 921 We expect the SOA record for the zone to be returned in the answer 922 section, the rcode to be set to NOERROR, and the AA and QR bits to be 923 set in the response, AD may be set in the response if the server 924 supports DNSSEC otherwise it should be clear; RA may also be set 925 [RFC1034]. We expect an OPT record to be returned. There should be 926 no EDNS flags other than DO present in the response which should be 927 present if the server supports DNSSEC. The EDNS version field should 928 be 0 and there should be no EDNS options present [RFC6891]. 930 Check that DO=1 queries work (EDNS supported): 932 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 934 expect: status: NOERROR 935 expect: the SOA record to be present in the answer section 936 expect: an OPT record to be present in the additional section 937 expect: DO=1 to be present if an RRSIG is in the response 938 expect: EDNS Version 0 in response 939 expect: flag: aa to be present 941 8.2.9. Testing EDNS Version Negotiation With DO=1 943 Ask for the SOA record of the configured zone, which does not need to 944 be DNSSEC signed. This query is made with no DNS flag bits set. 945 EDNS version 1 is used without any EDNS options. The only EDNS flag 946 set is DO. 948 We expect the SOA record for the zone to NOT be returned in the 949 answer section, the rcode to be set to NOERROR, ; the QR bit and 950 possibly the RA bit to be set [RFC1034]. We expect an OPT record to 951 be returned. There should be no EDNS flags other than DO present in 952 the response which should be there if the server supports DNSSEC. 953 The EDNS version field should be 0 and there should be no EDNS 954 options present [RFC6891]. 956 Check that EDNS version 1, DO=1 queries work (EDNS supported): 958 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 959 $zone @$server 961 expect: status: BADVERS 962 expect: SOA record to NOT be present 963 expect: an OPT record to be present in the additional section 964 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 965 returned DO=1 966 expect: EDNS Version 0 in response 967 expect: flag: aa to NOT be present 969 8.2.10. Testing With Multiple Defined EDNS Options 971 Ask for the SOA record of the configured zone. This query is made 972 with no DNS flag bits set. EDNS version 0 is used. A number of 973 defined EDNS options are present (NSID [RFC5001], DNS COOKIE 974 [RFC7873], EDNS Client Subnet [RFC7871] and EDNS Expire [RFC7314]). 976 We expect the SOA record for the zone to be returned in the answer 977 section, the rcode to be set to NOERROR, and the AA and QR bits to be 978 set in the header; RA may also be set [RFC1034]. We expect an OPT 979 record to be returned. There should be no EDNS flags present in the 980 response. The EDNS version field should be 0. Any of the requested 981 EDNS options supported by the server and permitted server 982 configuration may be returned [RFC6891]. 984 Check that EDNS queries with multiple defined EDNS options work: 986 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 987 soa $zone @$server 989 expect: status: NOERROR 990 expect: the SOA record to be present in the answer section 991 expect: an OPT record to be present in the additional section 992 expect: EDNS Version 0 in response 993 expect: flag: aa to be present 994 expect: flag: ad to NOT be present 996 8.3. When EDNS Is Not Supported 998 If EDNS is not supported by the nameserver, we expect a response to 999 each of the above queries. That response may be a FORMERR error 1000 response or the OPT record may just be ignored. 1002 Some nameservers only return a EDNS response when a particular EDNS 1003 option or flag (e.g. DO=1) is present in the request. This 1004 behaviour is not compliant behaviour and may hide other incorrect 1005 behaviour from the above tests. Re-testing with the triggering 1006 option / flag present will expose this misbehaviour. 1008 9. Remediation 1010 Name server operators are generally expected to test their own 1011 infrastructure for compliance to standards. The above tests should 1012 be run when new systems are brought online, and should be repeated 1013 periodically to ensure continued interoperability. 1015 Domain registrants who do not maintain their own DNS infrastructure 1016 are entitled to a DNS service that conforms to standards and 1017 interoperates well. Registrants who become aware that their DNS 1018 operator does not have a well maintained or compliant infrastructure 1019 should insist that their service provider correct issues, and switch 1020 providers if they do not. 1022 In the event that an operator experiences problems due to the 1023 behaviour of name servers outside their control, the above tests will 1024 help in narrowing down the precise issue(s) which can then be 1025 reported to the relevant party. 1027 If contact information for the operator of a misbehaving name server 1028 is not already known, the following methods of communication could be 1029 considered: 1031 o the RNAME of the zone authoritative for the name of the 1032 misbehaving server 1034 o the RNAME of zones for which the offending server is authoritative 1036 o administrative or technical contacts listed in the registration 1037 information for the parent domain of the name of the misbehaving 1038 server, or for zones for which the name server is authoritative 1040 o the registrar or registry for such zones 1042 o DNS-specific operational fora (e.g. mailing lists) 1044 Operators of parent zones may wish to regularly test the 1045 authoritative name servers of their child zones. However, parent 1046 operators can have widely varying capabilities in terms of 1047 notification or remediation depending on whether they have a direct 1048 relationship with the child operator. Many TLD registries, for 1049 example, cannot directly contact their registrants and may instead 1050 need to communicate through the relevant registrar. In such cases 1051 it may be most efficient for registrars to take on the responsibility 1052 for testing the name servers of their registrants, since they have a 1053 direct relationship. 1055 When notification is not effective at correcting problems with a 1056 misbehaving name server, parent operators can choose to remove NS 1057 record sets (and glue records below) that refer to the faulty server 1058 until the servers are fixed. This should only be done as a last 1059 resort and with due consideration, as removal of a delegation can 1060 have unanticipated side effects. For example, other parts of the DNS 1061 tree may depend on names below the removed zone cut, and the parent 1062 operator may find themselves responsible for causing new DNS failures 1063 to occur. 1065 10. Security Considerations 1067 Testing protocol compliance can potentially result in false reports 1068 of attempts to break services from Intrusion Detection Services and 1069 firewalls. All of the tests are well-formed (though not necessarily 1070 common) DNS queries. None the tests listed above should cause any 1071 harm to a protocol-compliant server. 1073 Relaxing firewall settings to ensure EDNS compliance could 1074 potentially expose a critical implementation flaw in the nameserver. 1075 Nameservers should be tested for conformance before relaxing firewall 1076 settings. 1078 When removing delegations for non-compliant servers there can be a 1079 knock on effect on other zones that require these zones to be 1080 operational for the nameservers addresses to be resolved. 1082 11. IANA Considerations 1084 There are no actions for IANA. 1086 12. References 1088 12.1. Normative References 1090 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1091 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1092 . 1094 [RFC1035] Mockapetris, P., "Domain names - implementation and 1095 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1096 November 1987, . 1098 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1099 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1100 . 1102 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1103 Rose, "Protocol Modifications for the DNS Security 1104 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1105 . 1107 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1108 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1109 DOI 10.17487/RFC6840, February 2013, 1110 . 1112 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1113 for DNS (EDNS(0))", STD 75, RFC 6891, 1114 DOI 10.17487/RFC6891, April 2013, 1115 . 1117 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1118 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1119 April 2013, . 1121 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1122 D. Wessels, "DNS Transport over TCP - Implementation 1123 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1124 . 1126 12.2. Informative References 1128 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1129 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1130 . 1132 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record 1133 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 1134 2003, . 1136 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1137 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1138 . 1140 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1141 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1142 . 1144 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1145 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1146 DOI 10.17487/RFC7871, May 2016, 1147 . 1149 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1150 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1151 . 1153 Authors' Addresses 1154 M. Andrews 1155 Internet Systems Consortium 1156 950 Charter Street 1157 Redwood City, CA 94063 1158 US 1160 Email: marka@isc.org 1162 Ray Bellis 1163 Internet Systems Consortium 1164 950 Charter Street 1165 Redwood City, CA 94063 1166 US 1168 Email: ray@isc.org