idnits 2.17.1 draft-ietf-dnsop-no-response-issue-10.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 1022 has weird spacing: '...r zones for ...' -- The document date (July 20, 2018) is 2100 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: January 21, 2019 July 20, 2018 7 A Common Operational Problem in DNS Servers - Failure To Respond. 8 draft-ietf-dnsop-no-response-issue-10 10 Abstract 12 The DNS is a query / response protocol. Failing to respond to 13 queries, or responding incorrectly, causes both immediate operational 14 problems and long term problems with protocol development. 16 This document identifies a number of common kinds of queries to which 17 some servers either fail to respond or else respond incorrectly. 18 This document also suggests procedures for TLD and other zone 19 operators to apply to help reduce / eliminate the problem. 21 The document does not look at the DNS data itself, just the structure 22 of the responses. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on January 21, 2019. 41 Copyright Notice 43 Copyright (c) 2018 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. Consequences . . . . . . . . . . . . . . . . . . . . . . . . 4 60 3. Common queries kinds that result in non responses. . . . . . 5 61 3.1. Basic DNS Queries . . . . . . . . . . . . . . . . . . . . 5 62 3.1.1. Zone Existence . . . . . . . . . . . . . . . . . . . 5 63 3.1.2. Unknown / Unsupported Type Queries . . . . . . . . . 5 64 3.1.3. DNS Flags . . . . . . . . . . . . . . . . . . . . . . 6 65 3.1.4. Unknown DNS opcodes . . . . . . . . . . . . . . . . . 6 66 3.1.5. Recursive Queries . . . . . . . . . . . . . . . . . . 6 67 3.1.6. TCP Queries . . . . . . . . . . . . . . . . . . . . . 6 68 3.2. EDNS Queries . . . . . . . . . . . . . . . . . . . . . . 6 69 3.2.1. EDNS Queries - Version Independent . . . . . . . . . 7 70 3.2.2. EDNS Queries - Version Specific . . . . . . . . . . . 7 71 3.2.3. EDNS Options . . . . . . . . . . . . . . . . . . . . 7 72 3.2.4. EDNS Flags . . . . . . . . . . . . . . . . . . . . . 7 73 3.2.5. Truncated EDNS Responses . . . . . . . . . . . . . . 8 74 3.2.6. DO Bit Handling . . . . . . . . . . . . . . . . . . . 8 75 3.2.7. EDNS over TCP . . . . . . . . . . . . . . . . . . . . 8 76 4. Firewalls and Load Balancers . . . . . . . . . . . . . . . . 8 77 5. Scrubbing Services . . . . . . . . . . . . . . . . . . . . . 9 78 6. Whole Answer Caches . . . . . . . . . . . . . . . . . . . . . 10 79 7. Response Code Selection . . . . . . . . . . . . . . . . . . . 10 80 8. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 81 8.1. Testing - Basic DNS . . . . . . . . . . . . . . . . . . . 11 82 8.1.1. Is The Server Configured For The Zone? . . . . . . . 11 83 8.1.2. Testing Unknown Types . . . . . . . . . . . . . . . . 11 84 8.1.3. Testing Header Bits . . . . . . . . . . . . . . . . . 12 85 8.1.4. Testing Unknown Opcodes . . . . . . . . . . . . . . . 13 86 8.1.5. Testing Recursive Queries . . . . . . . . . . . . . . 14 87 8.1.6. Testing TCP . . . . . . . . . . . . . . . . . . . . . 14 88 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 15 89 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 15 90 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 16 91 8.2.3. Testing Unknown EDNS Options . . . . . . . . . . . . 16 92 8.2.4. Testing Unknown EDNS Flags . . . . . . . . . . . . . 17 93 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS 94 Flags . . . . . . . . . . . . . . . . . . . . . . . . 18 95 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS 96 Options . . . . . . . . . . . . . . . . . . . . . . . 18 98 8.2.7. Testing Truncated Responses . . . . . . . . . . . . . 19 99 8.2.8. Testing DNSSEC Queries . . . . . . . . . . . . . . . 19 100 8.2.9. Testing EDNS Version Negotiation With DNSSEC . . . . 20 101 8.2.10. Testing With Multiple Defined EDNS Options . . . . . 21 102 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 21 103 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 22 104 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 105 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 106 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 107 12.1. Normative References . . . . . . . . . . . . . . . . . . 23 108 12.2. Informative References . . . . . . . . . . . . . . . . . 24 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25 111 1. Introduction 113 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failing 114 to respond to queries, or responding incorrectly, causes both 115 immediate operational problems and long term problems with protocol 116 development. 118 Failure to respond to a query is indistinguishable from packet loss 119 without doing an analysis of query-response patterns. Additionally 120 failure to respond results in unnecessary queries being made by DNS 121 clients, and introduces delays to the resolution process. 123 Due to the inability to distinguish between packet loss and 124 nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes 125 misclassified as lack of EDNS support which can lead to DNSSEC 126 validation failures. 128 The existance of servers which fail to respond to queries results in 129 developers being hesitant to deploy new standards. Such servers need 130 to be identified and remediated. 132 The DNS has response codes that cover almost any conceivable query 133 response. A nameserver should be able to respond to any conceivable 134 query using them. There should be no need to drop queries because a 135 nameserver does not understand them. 137 Unless a nameserver is under attack, it should respond to all queries 138 directed to it. When a nameserver is under attack it may wish to 139 drop packets. A common attack is to use a nameserver as a amplifier 140 by sending spoofed packets. This is done because response packets 141 are bigger than the queries and big amplification factors are 142 available especially if EDNS is supported. Limiting the rate of 143 responses is reasonable when this is occurring and the client should 144 retry. This however only works if legitimate clients are not being 145 forced to guess whether EDNS queries are accepted or not. While 146 there is still a pool of servers that don't respond to EDNS requests, 147 clients have no way to know if the lack of response is due to packet 148 loss, EDNS packets not being supported, or rate limiting due to the 149 server being under attack. Misclassification of server behaviour is 150 unavoidable when rate limiting is used until the population of 151 servers which fail to respond to well formed queries drops to near 152 zero. 154 A nameserver should not assume that there isn't a delegation to the 155 server even if it is not configured to serve the zone. Misconfigured 156 nameservers are a common occurrence in the DNS and receiving queries 157 for zones that the server is not configured for is not necessarily an 158 indication that the server is under attack. Parent zone operators 159 are advised to regularly check that the delegating NS records are 160 consistent with those of the delegated zone and to correct them when 161 they are not [RFC1034]. Doing this regularly should reduce the 162 instances of broken delegations. 164 2. Consequences 166 Failure to follow the relevant DNS RFCs has multiple adverse 167 consequences. Some are caused directly from the non-compliant 168 behaviour and others as a result of work-arounds forced on recursive 169 servers. Addressing known issues now will reduce future 170 interoperability issues as the DNS protocol continues to evolve and 171 clients make use of newly-introduced DNS features. 173 Some examples of known consequences include: 175 o The AD flag bit in a response cannot be trusted to mean anything 176 as some servers incorrectly copy the flag bit from the request to 177 the response [RFC1035], [RFC4035]. 179 o Widespread non-response to EDNS queries has lead to recursive 180 servers having to assume that EDNS is not supported and that 181 fallback to plain DNS is required, potentially causing DNSSEC 182 validation failures. 184 o Widespread non-response to EDNS options, requires recursive 185 servers to have to decide whether to probe to see if it is the 186 EDNS option or just EDNS that is causing the non response. In the 187 limited amount of time required to resolve a query before the 188 client times out this is not possible. 190 o Incorrectly returning FORMERR to a EDNS option being present, 191 leads to the recursive server not being able to determine if the 192 server is just broken in the handling of the EDNS option or 193 doesn't support EDNS at all. 195 o Mishandling of unknown query types has contributed to the 196 abandoning of the transition of the SPF type. 198 o Mishandling of unknown query types has slowed up the development 199 of DANE and resulted in additional rules being specified to reduce 200 the probability of interacting with a broken server when making 201 TLSA queries. 203 The consequences of servers not following the RFCs will only grow if 204 measures are not put in place to remove non compliant servers from 205 the ecosystem. Working around issues due to non-compliance with RFCs 206 is not sustainable. 208 Most (if not all) of these consequences could have been avoided if 209 action had been taken to remove non-compliant servers as soon as 210 people were aware of them, i.e. to actively seek out broken 211 implementations and servers and inform their developers and operators 212 that they need to fix their servers. 214 3. Common queries kinds that result in non responses. 216 There are a number common query kinds that fail to respond today. 217 They are: EDNS queries with and without extensions; queries for 218 unknown (unallocated) or unsupported types; and filtering of TCP 219 queries. 221 3.1. Basic DNS Queries 223 3.1.1. Zone Existence 225 Initially, to test existence of the zone, an SOA query should be 226 made. If the SOA record is not returned but some other response is 227 returned, this is 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.4. Unknown DNS opcodes 252 The use of previously undefined opcodes is to be expected. Since the 253 DNS was first defined two new opcodes have been added, UPDATE and 254 NOTIFY. 256 NOTIMP is the expected rcode to an unknown or unimplemented opcode. 258 Note: while new opcodes will most probably use the current layout 259 structure for the rest of the message there is no requirement that 260 anything other than the DNS header match. 262 3.1.5. Recursive Queries 264 A non-recursive server is supposed to respond to recursive queries as 265 if the RD bit is not set [RFC1034]. 267 3.1.6. 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 specifion left this behaviour undefined 323 [RFC2671]. 325 3.2.4. EDNS Flags 327 Some servers fail to respond to EDNS queries with EDNS flags set. 328 Server should ignore EDNS flags they do not understand and should 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. 340 3.2.6. DO Bit Handling 342 Some nameservers incorrectly only return a EDNS response when the DO 343 bit is present in the query. Additionally some nameservers fail to 344 copy the DO bit to the response despite clearly supporting DNSSEC by 345 returning RRSIG records to EDNS queries with the DO bit set. 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 449 instead.
 451 If a zone cannot be loaded because it contains unimplemented type 452 codes that are not encoded as unknown record types according to 453 [RFC3597] then the expected response is SERVFAIL. 455 If the server supports EDNS and receives a query with an unsupported 456 EDNS version, the correct response is BADVERS [RFC6891]. 458 If the server does not support EDNS at all, FORMERR and NOTIMP are 459 the expected error codes. That said a minimal EDNS server 460 implementation requires parsing the OPT records and responding with 461 an empty OPT record. There is no need to interpret any EDNS options 462 present in the request as unsupported EDNS options are expected to be 463 ignored [RFC6891]. 465 8. Testing 467 Testing is divided into two sections. "Basic DNS", which all servers 468 should meet, and "Extended DNS", which should be met by all servers 469 that support EDNS (a server is deemed to support EDNS if it gives a 470 valid EDNS response to any EDNS query). If a server does not support 471 EDNS it should still respond to all the tests. 473 It is advisable to run all of the tests below in parallel so as to 474 minimise the delays due to multiple timeouts when the servers do not 475 respond. There are 16 queries directed to each nameserver (assuming 476 no packet loss) testing different aspects of Basic DNS and Extended 477 DNS. 479 The tests below use dig from BIND 9.11.0. 481 8.1. Testing - Basic DNS 483 This first set of tests cover basic DNS server behaviour and all 484 servers should pass these tests. 486 8.1.1. Is The Server Configured For The Zone? 488 Ask for the SOA record of the zone the server is nominally configured 489 to serve. This query is made with no DNS flag bits set and without 490 EDNS. 492 We expect the SOA record for the zone to be returned in the answer 493 section with the rcode set to NOERROR and the AA and QR bits to be 494 set in the response, RA may also be set [RFC1034]. We do not expect 495 an OPT record to be returned [RFC6891]. 497 Verify the server is configured for the zone: 499 dig +noedns +noad +norec soa $zone @$server 501 expect: status: NOERROR 502 expect: the SOA record to be present in the answer section 503 expect: flag: aa to be present 504 expect: flag: rd to NOT be present 505 expect: flag: ad to NOT be present 506 expect: the OPT record to NOT be present 508 8.1.2. Testing Unknown Types 510 Ask for the TYPE1000 record at the zone's name. This query is made 511 with no DNS flag bits set and without EDNS. TYPE1000 has been chosen 512 for this purpose as IANA is unlikely to allocate this type in the 513 near future and it is not in a range reserved for private use 514 [RFC6895]. 516 We expect no records to be returned in the answer section with the 517 rcode set to NOERROR and the AA and QR bits to be set in the 518 response. RA may also be set [RFC1034]. We do not expect an OPT 519 record to be returned [RFC6891]. 521 Check that queries for an unknown type work: 523 dig +noedns +noad +norec type1000 $zone @$server 525 expect: status: NOERROR 526 expect: an empty answer section. 527 expect: flag: aa to be present 528 expect: flag: rd to NOT be present 529 expect: flag: ad to NOT be present 530 expect: the OPT record to NOT be present 532 8.1.3. Testing Header Bits 534 8.1.3.1. Testing CD=1 Queries 536 Ask for the SOA record of the zone the server is nominally configured 537 to serve. This query is made with only the CD DNS flag bit set and 538 all other DNS bits clear and without EDNS. 540 We expect the SOA record for the zone to be returned in the answer 541 section with the rcode set to NOERROR and the AA and QR bits to be 542 set in the response. We do not expect an OPT record to be returned. 544 If the server supports DNSSEC, CD should be set in the response 545 [RFC4035] otherwise CD should be clear [RFC1034]. 547 Check that queries with CD=1 work: 549 dig +noedns +noad +norec +cd soa $zone @$server 551 expect: status: NOERROR 552 expect: the SOA record to be present in the answer section 553 expect: flag: aa to be present 554 expect: flag: rd to NOT be present 555 expect: flag: ad to NOT be present 556 expect: the OPT record to NOT be present 558 8.1.3.2. Testing AD=1 Queries 560 Ask for the SOA record of the zone the server is nominally configured 561 to serve. This query is made with only the AD DNS flag bit set and 562 all other DNS bits clear and without EDNS. 564 We expect the SOA record for the zone to be returned in the answer 565 section with the rcode set to NOERROR and the AA and QR bits to be 566 set in the response. We do not expect an OPT record to be returned. 567 The purpose of this query is to detect blocking of queries with the 568 AD bit present, not the specific value of AD in the response. 570 Check that queries with AD=1 work: 572 dig +noedns +norec +ad soa $zone @$server 574 expect: status: NOERROR 575 expect: the SOA record to be present in the answer section 576 expect: flag: aa to be present 577 expect: flag: rd to NOT be present 578 expect: the OPT record to NOT be present 580 AD use in queries is defined in [RFC6840]. 582 8.1.3.3. Testing Reserved Bit 584 Ask for the SOA record of the zone the server is nominally configured 585 to serve. This query is made with only the final reserved DNS flag 586 bit set and all other DNS bits clear and without EDNS. 588 We expect the SOA record for the zone to be returned in the answer 589 section with the rcode set to NOERROR and the AA and QR bits to be 590 set in the response, RA may be set. The final reserved bit must not 591 be set [RFC1034]. We do not expect an OPT record to be returned 592 [RFC6891]. 594 Check that queries with the last unassigned DNS header flag work and 595 that the flag bit is not copied to the response: 597 dig +noedns +noad +norec +zflag soa $zone @$server 599 expect: status: NOERROR 600 expect: the SOA record to be present in the answer section 601 expect: MBZ to NOT be in the response (see below) 602 expect: flag: aa to be present 603 expect: flag: rd to NOT be present 604 expect: flag: ad to NOT be present 605 expect: the OPT record to NOT be present 607 MBZ (Must Be Zero) is a dig-specific indication that the flag bit has 608 been incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved 609 for future use. Must be zero in all queries and responses." 611 8.1.4. Testing Unknown Opcodes 613 Construct a DNS message that consists of only a DNS header with 614 opcode set to 15 (currently not allocated), no DNS header bits set 615 and empty question, answer, authority and additional sections. 617 Check that new opcodes are handled: 619 dig +noedns +noad +opcode=15 +norec +header-only @$server 621 expect: status: NOTIMP 622 expect: opcode: 15 623 expect: all sections to be empty 624 expect: flag: aa to NOT be present 625 expect: flag: rd to NOT be present 626 expect: flag: ad to NOT be present 627 expect: the OPT record to NOT be present 629 8.1.5. Testing Recursive Queries 631 Ask for the SOA record of the zone the server is nominally configured 632 to serve. This query is made with only the RD DNS flag bit set and 633 without EDNS. 635 We expect the SOA record for the zone to be returned in the answer 636 section with the rcode set to NOERROR and the AA, QR and RD bits to 637 be set in the response, RA may also be set [RFC1034]. We do not 638 expect an OPT record to be returned [RFC6891]. 640 Check that recursive queries work: 642 dig +noedns +noad +rec soa $zone @$server 644 expect: status: NOERROR 645 expect: the SOA record to be present in the answer section 646 expect: flag: aa to be present 647 expect: flag: rd to be present 648 expect: flag: ad to NOT be present 649 expect: the OPT record to NOT be present 651 8.1.6. Testing TCP 653 Ask for the SOA record of the zone the server is nominally configured 654 to serve. This query is made with no DNS flag bits set and without 655 EDNS. This query is to be sent using TCP. 657 We expect the SOA record for the zone to be returned in the answer 658 section with the rcode set to NOERROR and the AA and QR bits to be 659 set in the response, RA may also be set [RFC1034]. We do not expect 660 an OPT record to be returned [RFC6891]. 662 Check that TCP queries work: 664 dig +noedns +noad +norec +tcp soa $zone @$server 666 expect: status: NOERROR 667 expect: the SOA record to be present in the answer section 668 expect: flag: aa to be present 669 expect: flag: rd to NOT be present 670 expect: flag: ad to NOT be present 671 expect: the OPT record to NOT be present 673 The requirement that TCP be supported is defined in [RFC7766]. 675 8.2. Testing - Extended DNS 677 The next set of test cover various aspects of EDNS behaviour. If any 678 of these tests succeed, then all of them should succeed. There are 679 servers that support EDNS but fail to handle plain EDNS queries 680 correctly so a plain EDNS query is not a good indicator of lack of 681 EDNS support. 683 8.2.1. Testing Minimal EDNS 685 Ask for the SOA record of the zone the server is nominally configured 686 to serve. This query is made with no DNS flag bits set. EDNS 687 version 0 is used without any EDNS options or EDNS flags set. 689 We expect the SOA record for the zone to be returned in the answer 690 section with the rcode set to NOERROR and the AA and QR bits to be 691 set in the response, RA may also be set [RFC1034]. We expect an OPT 692 record to be returned. There should be no EDNS flags present in the 693 response. The EDNS version field should be zero and there should be 694 no EDNS options present [RFC6891]. 696 Check that plain EDNS queries work: 698 dig +nocookie +edns=0 +noad +norec soa $zone @$server 700 expect: status: NOERROR 701 expect: the SOA record to be present in the answer section 702 expect: an OPT record to be present in the additional section 703 expect: EDNS Version 0 in response 704 expect: flag: aa to be present 705 expect: flag: ad to NOT be present 707 +nocookie disables sending a EDNS COOKIE option in which is on by 708 default in BIND 9.11.0. 710 8.2.2. Testing EDNS Version Negotiation 712 Ask for the SOA record of the zone the server is nominally configured 713 to serve. This query is made with no DNS flag bits set. EDNS 714 version 1 is used without any EDNS options or EDNS flags set. 716 We expect the SOA record for the zone to NOT be returned in the 717 answer section with the extended rcode set to BADVERS and the QR bit 718 to be set in the response, RA may also be set [RFC1034]. We expect 719 an OPT record to be returned. There should be no EDNS flags present 720 in the response. The EDNS version field should be zero as EDNS 721 versions other than 0 are yet to be specified and there should be no 722 EDNS options present [RFC6891]. 724 Check that EDNS version 1 queries work (EDNS supported): 726 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 728 expect: status: BADVERS 729 expect: the SOA record to NOT be present in the answer section 730 expect: an OPT record to be present in the additional section 731 expect: EDNS Version 0 in response 732 expect: flag: aa to NOT be present 733 expect: flag: ad to NOT be present 735 Only EDNS Version 0 is currently defined so the response should 736 always be a 0 version. This will change when EDNS version 1 is 737 defined. BADVERS is the expected rcode if EDNS is supported as per 738 Section 6.1.3, [RFC6891]. 740 8.2.3. Testing Unknown EDNS Options 742 Ask for the SOA record of the zone the server is nominally configured 743 to serve. This query is made with no DNS flag bits set. EDNS 744 version 0 is used without any EDNS flags. A EDNS option is present 745 with a value from the yet to be assigned range. The unassigned value 746 chosen is 100 and will need to be adjusted when IANA assigns this 747 value formally. 749 We expect the SOA record for the zone to be returned in the answer 750 section with the rcode set to NOERROR and the AA and QR bits to be 751 set in the response, RA may also be set [RFC1034]. We expect an OPT 752 record to be returned. There should be no EDNS flags present in the 753 response. The EDNS version field should be zero as EDNS versions 754 other than 0 are yet to be specified and there should be no EDNS 755 options present as unknown EDNS options are supposed to be ignored by 756 the server [RFC6891]. 758 Check that EDNS queries with an unknown option work (EDNS supported): 760 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 762 expect: status: NOERROR 763 expect: the SOA record to be present in the answer section 764 expect: an OPT record to be present in the additional section 765 expect: OPT=100 to NOT be present 766 expect: EDNS Version 0 in response 767 expect: flag: aa to be present 768 expect: flag: ad to NOT be present 770 Unknown EDNS options are supposed to be ignored, Section 6.1.2, 771 [RFC6891]. 773 8.2.4. Testing Unknown EDNS Flags 775 Ask for the SOA record of the zone the server is nominally configured 776 to serve. This query is made with no DNS flag bits set. EDNS 777 version 0 is used without any EDNS options. A unassigned EDNS flag 778 bit is set (0x40 in this case). 780 We expect the SOA record for the zone to be returned in the answer 781 section with the rcode set to NOERROR and the AA and QR bits to be 782 set in the response, 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 as unknown EDNS flags are supposed to be ignored. The EDNS 785 version field should be zero and there should be no EDNS options 786 present [RFC6891]. 788 Check that EDNS queries with unknown flags work (EDNS supported): 790 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 792 expect: status: NOERROR 793 expect: the SOA record to be present in the answer section 794 expect: an OPT record to be present in the additional section 795 expect: MBZ not to be present 796 expect: EDNS Version 0 in response 797 expect: flag: aa to be present 798 expect: flag: ad to NOT be present 800 MBZ (Must Be Zero) presence indicates the flag bit has been 801 incorrectly copied as per Section 6.1.4, [RFC6891]. 803 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 805 Ask for the SOA record of the zone the server is nominally configured 806 to serve. This query is made with no DNS flag bits set. EDNS 807 version 1 is used without any EDNS options. A unassigned EDNS flag 808 bit is set (0x40 in this case). 810 We expect the SOA record for the zone to NOT be returned in the 811 answer section with the extended rcode set to BADVERS and the QR bit 812 to be set in the response, RA may also be set [RFC1034]. We expect 813 an OPT record to be returned. There should be no EDNS flags present 814 in the response as unknown EDNS flags are supposed to be ignored. 815 The EDNS version field should be zero as EDNS versions other than 0 816 are yet to be specified and there should be no EDNS options present 817 [RFC6891]. 819 Check that EDNS version 1 queries with unknown flags work (EDNS 820 supported): 822 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 823 $zone @$server 825 expect: status: BADVERS 826 expect: SOA record to NOT be present 827 expect: an OPT record to be present in the additional section 828 expect: MBZ not to be present 829 expect: EDNS Version 0 in response 830 expect: flag: aa to NOT be present 831 expect: flag: ad to NOT be present 833 +noednsneg disables EDNS version negotiation in DiG; MBZ (Must Be 834 Zero) presence indicates the flag bit has been incorrectly copied. 836 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 838 Ask for the SOA record of the zone the server is nominally configured 839 to serve. This query is made with no DNS flag bits set. EDNS 840 version 1 is used. A unknown EDNS option is present (option code 100 841 has been chosen). 843 We expect the SOA record for the zone to NOT be returned in the 844 answer section with the extended rcode set to BADVERS and the QR bit 845 to be set in the response, RA may also be set [RFC1034]. We expect 846 an OPT record to be returned. There should be no EDNS flags present 847 in the response. The EDNS version field should be zero as EDNS 848 versions other than 0 are yet to be specified and there should be no 849 EDNS options present [RFC6891]. 851 Check that EDNS version 1 queries with unknown options work (EDNS 852 supported): 854 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 855 $zone @$server 857 expect: status: BADVERS 858 expect: SOA record to NOT be present 859 expect: an OPT record to be present in the additional section 860 expect: OPT=100 to NOT be present 861 expect: EDNS Version 0 in response 862 expect: flag: aa to be present 863 expect: flag: ad to NOT be present 865 +noednsneg disables EDNS version negotiation in DiG. 867 8.2.7. Testing Truncated Responses 869 Ask for the DNSKEY records of the zone the server is nominally 870 configured to serve. This query is made with no DNS flag bits set. 871 EDNS version 0 is used without any EDNS options. The only EDNS flag 872 set is DO. The EDNS UDP buffer size is set to 512. The intention of 873 this query is elicit a truncated response from the server. Most 874 signed DNSKEY responses are bigger than 512 bytes. 876 We expect a response with the rcode set to NOERROR and the AA and QR 877 bits to be set, AD may be set in the response if the server supports 878 DNSSEC otherwise it should be clear. TC and RA may also be set 879 [RFC1034]. We expect an OPT record to be present in the response. 880 There should be no EDNS flags other than DO present in the response. 881 The EDNS version field should be zero and there should be no EDNS 882 options present [RFC6891]. 884 If TC is not set it is not possible to confirm that the server 885 correctly adds the OPT record to the truncated responses or not. 887 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 888 expect: NOERROR 889 expect: OPT record with version set to 0 891 8.2.8. Testing DNSSEC Queries 893 Ask for the SOA record of the zone the server is nominally configured 894 to serve. This query is made with no DNS flag bits set. EDNS 895 version 0 is used without any EDNS options. The only EDNS flag set 896 is DO. 898 We expect the SOA record for the zone to be returned in the answer 899 section with the rcode set to NOERROR and the AA and QR bits to be 900 set in the response, AD may be set in the response if the server 901 supports DNSSEC otherwise it should be clear. RA may also be set 902 [RFC1034]. We expect an OPT record to be returned. There should be 903 no EDNS flags other than DO present in the response which should be 904 present if the server supports DNSSEC. The EDNS version field should 905 be zero and there should be no EDNS options present [RFC6891]. 907 Check that a DNSSEC queries work (EDNS supported): 909 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 911 expect: status: NOERROR 912 expect: the SOA record to be present in the answer section 913 expect: an OPT record to be present in the additional section 914 expect: DO=1 to be present if a RRSIG is in the response 915 expect: EDNS Version 0 in response 916 expect: flag: aa to be present 918 DO=1 should be present if RRSIGs are returned as they indicate that 919 the server supports DNSSEC. Servers that support DNSSEC are supposed 920 to copy the DO bit from the request to the response as per [RFC3225]. 922 8.2.9. Testing EDNS Version Negotiation With DNSSEC 924 Ask for the SOA record of the zone the server is nominally configured 925 to serve. This query is made with no DNS flag bits set. EDNS 926 version 1 is used without any EDNS options. The only EDNS flag set 927 is DO. 929 We expect the SOA record for the zone to NOT be returned in the 930 answer section with the rcode set to BADVERS and the only the QR bit 931 and possibly the RA bit to be set [RFC1034]. We expect an OPT record 932 to be returned. There should be no EDNS flags other than DO present 933 in the response which should be present if the server supports 934 DNSSEC. The EDNS version field should be zero and there should be no 935 EDNS options present [RFC6891]. 937 Check that EDNS version 1 DNSSEC queries work (EDNS supported): 939 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 940 $zone @$server 942 expect: status: BADVERS 943 expect: SOA record to NOT be present 944 expect: an OPT record to be present in the additional section 945 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 946 returned DO=1 947 expect: EDNS Version 0 in response 948 expect: flag: aa to NOT be present 950 +noednsneg disables EDNS version negotiation in DiG. 952 8.2.10. Testing With Multiple Defined EDNS Options 954 Ask for the SOA record of the zone the server is nominally configured 955 to serve. This query is made with no DNS flag bits set. EDNS 956 version 0 is used. A number of defined EDNS options are present 957 (NSID [RFC5001], DNS COOKIE [RFC7873], EDNS Client Subnet [RFC7871] 958 and EDNS Expire [RFC7314]). 960 We expect the SOA record for the zone to be returned in the answer 961 section with the rcode set to NOERROR and the AA and QR bits to be 962 set in the response, RA may also be set [RFC1034]. We expect an OPT 963 record to be returned. There should be no EDNS flags present in the 964 response. The EDNS version field should be zero. Any of the 965 requested EDNS options supported by the server and permitted server 966 configuration may be returned [RFC6891]. 968 Check that EDNS queries with multiple defined EDNS options work: 970 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 971 soa $zone @$server 973 expect: status: NOERROR 974 expect: the SOA record to be present in the answer section 975 expect: an OPT record to be present in the additional section 976 expect: EDNS Version 0 in response 977 expect: flag: aa to be present 978 expect: flag: ad to NOT be present 980 8.3. When EDNS Is Not Supported 982 If EDNS is not supported by the nameserver, we expect a response to 983 all the above queries. That response may be a FORMERR or NOTIMP 984 error response or the OPT record may just be ignored. 986 Some nameservers only return a EDNS response when a particular EDNS 987 option or flag (e.g. DO=1) is present in the request. This 988 behaviour is not compliant behaviour and may hide other incorrect 989 behaviour from the above tests. Re-testing with the triggering 990 option / flag present will expose this misbehaviour. 992 9. Remediation 994 Name server operators are generally expected to test their own 995 infrastructure for compliance to standards. The above tests should 996 be run when new systems are brought online, and should be repeated 997 periodically to ensure continued interoperability. 999 Domain registrants who do not maintain their own DNS infrastructure 1000 are entitled to a DNS service that conforms to standards and 1001 interoperates well. Registrants who become aware that their DNS 1002 operator does not have a well maintained or compliant infrastructure 1003 should insist that their service provider correct issues, and switch 1004 providers if they do not. 1006 In the event that an operator experiences problems due to the 1007 behaviour of name servers outside their control, the above tests will 1008 help in narrowing down the precise issue(s) which can then be 1009 reported to the relevant party. 1011 If contact information for the operator of a misbehaving name server 1012 is not already known, the following methods of communication could be 1013 considered: 1015 o the RNAME of the zone authoritative for the name of the 1016 misbehaving server 1018 o the RNAME of zones for which the offending server is authoritative 1020 o administrative or technical contacts listed in the registration 1021 information for the parent domain of the name of the misbehaving 1022 server, or for zones for which the name server is authoritative 1024 o the registrar or registry for such zones 1026 o DNS-specific operational fora (e.g. mailing lists) 1028 Operators of parent zones may wish to regularly test the 1029 authoritative name servers of their child zones. However, parent 1030 operators can have widely varying capabilities in terms of 1031 notification or remediation depending on whether they have a direct 1032 relationship with the child operator. Many TLD registries, for 1033 example, cannot directly contact their registrants and may instead 1034 need to communicate through the relevant registrar. In such cases 1035 it may be most efficient for registrars to take on the responsibility 1036 for testing the name servers of their registrants, since they have a 1037 direct relationship. 1039 When notification is not effective at correcting problems with a 1040 misbehaving name server, parent operators can choose to remove NS 1041 record sets (and glue records below) that refer to the faulty server. 1042 This should only be done as a last resort and with due consideration, 1043 as removal of a delegation can have unanticipated side effects. For 1044 example, other parts of the DNS tree may depend on names below the 1045 removed zone cut, and the parent operator may find themselves 1046 responsible for causing new DNS failures to occur. 1048 10. Security Considerations 1050 Testing protocol compliance can potentially result in false reports 1051 of attempts to break services from Intrusion Detection Services and 1052 firewalls. None of the tests listed above should break nominally 1053 EDNS compliant servers. None of the tests above should break non 1054 EDNS servers. All the tests above are well formed, though not 1055 necessarily common, DNS queries. 1057 Relaxing firewall settings to ensure EDNS compliance could 1058 potentially expose a critical implementation flaw in the nameserver. 1059 Nameservers should be tested for conformance before relaxing firewall 1060 settings. 1062 When removing delegations for non-compliant servers there can be a 1063 knock on effect on other zones that require these zones to be 1064 operational for the nameservers addresses to be resolved. 1066 11. IANA Considerations 1068 There are no actions for IANA. 1070 12. References 1072 12.1. Normative References 1074 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1075 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1076 . 1078 [RFC1035] Mockapetris, P., "Domain names - implementation and 1079 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1080 November 1987, . 1082 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1083 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1084 . 1086 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1087 Rose, "Protocol Modifications for the DNS Security 1088 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1089 . 1091 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1092 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1093 DOI 10.17487/RFC6840, February 2013, 1094 . 1096 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1097 for DNS (EDNS(0))", STD 75, RFC 6891, 1098 DOI 10.17487/RFC6891, April 2013, 1099 . 1101 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1102 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1103 April 2013, . 1105 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1106 D. Wessels, "DNS Transport over TCP - Implementation 1107 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1108 . 1110 12.2. Informative References 1112 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1113 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1114 . 1116 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record 1117 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 1118 2003, . 1120 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1121 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1122 . 1124 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1125 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1126 . 1128 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1129 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1130 DOI 10.17487/RFC7871, May 2016, 1131 . 1133 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1134 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1135 . 1137 Authors' Addresses 1139 M. Andrews 1140 Internet Systems Consortium 1141 950 Charter Street 1142 Redwood City, CA 94063 1143 US 1145 Email: marka@isc.org 1147 Ray Bellis 1148 Internet Systems Consortium 1149 950 Charter Street 1150 Redwood City, CA 94063 1151 US 1153 Email: ray@isc.org