idnits 2.17.1 draft-ietf-dnsop-no-response-issue-11.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 1002 has weird spacing: '...r zones for ...' -- The document date (July 27, 2018) is 2099 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 28, 2019 July 27, 2018 7 A Common Operational Problem in DNS Servers - Failure To Respond. 8 draft-ietf-dnsop-no-response-issue-11 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 28, 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=1 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 . . . . . . . . . . . . . . . 14 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 . . . . . . . . . . . . . . . . . . . . . . . 19 98 8.2.7. Testing Truncated Responses . . . . . . . . . . . . . 19 99 8.2.8. Testing DO=1 Handling . . . . . . . . . . . . . . . . 20 100 8.2.9. Testing EDNS Version Negotiation With DO=1 . . . . . 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=1 Handling 342 Some nameservers incorrectly only return an EDNS response when the DO 343 bit [RFC3225] is 1 in the query. Additionally some nameservers fail 344 to copy the DO bit to the response despite clearly supporting DNSSEC 345 by returning an RRSIG records to EDNS queries with DO=1. 347 3.2.7. EDNS over TCP 349 Some EDNS aware servers incorrectly limit the TCP response sizes to 350 the advertised UDP response size. 352 4. Firewalls and Load Balancers 354 Firewalls and load balancers can affect the externally visible 355 behaviour of a nameserver. Tests for conformance should to be done 356 from outside of any firewall so that the system is tested as a whole. 358 Firewalls and load balancers should not drop DNS packets that they 359 don't understand. They should either pass the packets or generate an 360 appropriate error response. 362 Requests for unknown query types are normal client behaviour and 363 should not be construed as an attack. Nameservers have always been 364 expected to be able to handle such queries. 366 Requests for unknown query classes are normal client behaviour and 367 should not be construed as an attack. Nameservers have always been 368 expected to be able to handle such queries. 370 Requests with unknown opcodes are normal client behaviour and should 371 not be construed as an attack. Nameservers have always been expected 372 to be able to handle such queries. 374 Requests with unassigned flags set (DNS or EDNS) are expected client 375 behaviour and should not be construed as an attack. The behaviour 376 for unassigned flags is to ignore them in the request and to not set 377 them in the response. Dropping DNS / EDNS packets with unassigned 378 flags makes it difficult to deploy extensions that make use of them 379 due to the need to reconfigure and update firewalls. 381 Requests with unknown EDNS options are expected client behaviour and 382 should not be construed as an attack. The correct behaviour for 383 unknown EDNS options is to ignore their presence when constructing a 384 reply. 386 Requests with unknown EDNS versions are expected client behaviour and 387 should not be construed as an attack. The correct behaviour for 388 unknown EDNS versions is to return BADVERS along with the highest 389 EDNS version the server supports. Dropping EDNS packets breaks EDNS 390 version negotiation. 392 Firewalls should not assume that there will only be a single response 393 message to a request. There have been proposals to use EDNS to 394 signal that multiple DNS messages be returned rather than a single 395 UDP message that is fragmented at the IP layer. 397 DNS, and EDNS in particular, are designed to allow clients to be able 398 to use new features against older servers without having to validate 399 every option. Indiscriminate blocking of messages breaks that 400 design. 402 However, there may be times when a nameserver mishandles messages 403 with a particular flag, EDNS option, EDNS version field, opcode, type 404 or class field or combination thereof to the point where the 405 integrity of the nameserver is compromised. Firewalls should offer 406 the ability to selectively reject messages using an appropriately 407 constructed response based on all these fields while awaiting a fix 408 from the nameserver vendor. 410 5. Scrubbing Services 412 Scrubbing services can affect the externally visible behaviour of a 413 nameserver in a similar way to firewalls. If a operator uses a 414 scrubbing service, they should check that legitimate queries are not 415 being blocked. 417 Scrubbing services, unlike firewalls, are also turned on and off in 418 response to denial of service attacks. One needs to take care when 419 choosing a scrubbing service. 421 Ideally, Operators should run these tests against a scrubbing service 422 to ensure that these tests are not seen as attack vectors. 424 6. Whole Answer Caches 426 Whole answer caches take a previously constructed answer and return 427 it to a subsequent query for the same question. However, they can 428 return the wrong response if they do not take all of the relevant 429 attributes of the query into account. 431 In addition to the standard tuple of a non- 432 exhaustive set of attributes that must be considered include: RD, AD, 433 CD, OPT record, DO, EDNS buffer size, EDNS version, EDNS options, and 434 transport. 436 7. Response Code Selection 438 Choosing the correct response code when responding to DNS queries is 439 important. Response codes should be chosen considering how clients 440 will handle them. 442 For unimplemented opcodes NOTIMP is the expected response code. For 443 example, a new opcode could change the message format by extending 444 the header or changing the structure of the records etc. 446 For unimplemented type codes, and in the absence of other errors, the 447 only valid response is NoError if the qname exists, and NameError 448 (NXDOMAIN) otherwise. For Meta-RRs NOTIMP may be returned 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 These tests query for records at the apex of a zone that the server 474 is nominally configured to serve. All tests should use the same 475 zone. 477 It is advisable to run all of the tests below in parallel so as to 478 minimise the delays due to multiple timeouts when the servers do not 479 respond. There are 16 queries directed to each nameserver (assuming 480 no packet loss) testing different aspects of Basic DNS and Extended 481 DNS. 483 The tests below use dig from BIND 9.11.0. 485 8.1. Testing - Basic DNS 487 This first set of tests cover basic DNS server behaviour and all 488 servers should pass these tests. 490 8.1.1. Is The Server Configured For The Zone? 492 Ask for the SOA record of the configured zone. This query is made 493 with no DNS flag bits set and without EDNS. 495 We expect the SOA record for the zone to be returned in the answer 496 section with the rcode set to NOERROR and the AA and QR bits to be 497 set in the response; RA may also be set [RFC1034]. We do not expect 498 an OPT record to be returned [RFC6891]. 500 Verify the server is configured for the zone: 502 dig +noedns +noad +norec soa $zone @$server 504 expect: status: NOERROR 505 expect: the SOA record to be present in the answer section 506 expect: flag: aa to be present 507 expect: flag: rd to NOT be present 508 expect: flag: ad to NOT be present 509 expect: the OPT record to NOT be present 511 8.1.2. Testing Unknown Types 513 Ask for the TYPE1000 record at the configured zone's name. This 514 query is made with no DNS flag bits set and without EDNS. TYPE1000 515 has been chosen for this purpose as IANA is unlikely to allocate this 516 type in the near future and it is not in a range reserved for private 517 use [RFC6895]. 519 We expect no records to be returned in the answer section with the 520 rcode set to NOERROR and the AA and QR bits to be set in the 521 response; RA may also be set [RFC1034]. We do not expect an OPT 522 record to be returned [RFC6891]. 524 Check that queries for an unknown type work: 526 dig +noedns +noad +norec type1000 $zone @$server 528 expect: status: NOERROR 529 expect: an empty answer section. 530 expect: flag: aa to be present 531 expect: flag: rd to NOT be present 532 expect: flag: ad to NOT be present 533 expect: the OPT record to NOT be present 535 8.1.3. Testing Header Bits 537 8.1.3.1. Testing CD=1 Queries 539 Ask for the SOA record of the configured zone. This query is made 540 with only the CD DNS flag bit set and all other DNS bits clear and 541 without EDNS. 543 We expect the SOA record for the zone to be returned in the answer 544 section with the rcode set to NOERROR and the AA and QR bits to be 545 set in the response. We do not expect an OPT record to be returned. 547 If the server supports DNSSEC, CD should be set in the response 548 [RFC4035] otherwise CD should be clear [RFC1034]. 550 Check that queries with CD=1 work: 552 dig +noedns +noad +norec +cd soa $zone @$server 554 expect: status: NOERROR 555 expect: the SOA record to be present in the 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.2. Testing AD=1 Queries 563 Ask for the SOA record of the configured zone. This query is made 564 with only the AD DNS flag bit set and all other DNS bits clear and 565 without EDNS. 567 We expect the SOA record for the zone to be returned in the answer 568 section with the rcode set to NOERROR and the AA and QR bits to be 569 set in the response. We do not expect an OPT record to be returned. 570 The purpose of this query is to detect blocking of queries with the 571 AD bit present, not the specific value of AD in the response. 573 Check that queries with AD=1 work: 575 dig +noedns +norec +ad soa $zone @$server 577 expect: status: NOERROR 578 expect: the SOA record to be present in the answer section 579 expect: flag: aa to be present 580 expect: flag: rd to NOT be present 581 expect: the OPT record to NOT be present 583 AD use in queries is defined in [RFC6840]. 585 8.1.3.3. Testing Reserved Bit 587 Ask for the SOA record of the configured zone. This query is made 588 with only the final reserved DNS flag bit set and all other DNS bits 589 clear and without EDNS. 591 We expect the SOA record for the zone to be returned in the answer 592 section with the rcode set to NOERROR and the AA and QR bits to be 593 set in the response; RA may be set. The final reserved bit must not 594 be set [RFC1034]. We do not expect an OPT record to be returned 595 [RFC6891]. 597 Check that queries with the last unassigned DNS header flag work and 598 that the flag bit is not copied to the response: 600 dig +noedns +noad +norec +zflag soa $zone @$server 602 expect: status: NOERROR 603 expect: the SOA record to be present in the answer section 604 expect: MBZ to NOT be in the response (see below) 605 expect: flag: aa to be present 606 expect: flag: rd to NOT be present 607 expect: flag: ad to NOT be present 608 expect: the OPT record to NOT be present 610 MBZ (Must Be Zero) is a dig-specific indication that the flag bit has 611 been incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved 612 for future use. Must be zero in all queries and responses." 614 8.1.4. Testing Unknown Opcodes 616 Construct a DNS message that consists of only a DNS header with 617 opcode set to 15 (currently not allocated), no DNS header bits set 618 and empty question, answer, authority and additional sections. 620 Check that new opcodes are handled: 622 dig +noedns +noad +opcode=15 +norec +header-only @$server 624 expect: status: NOTIMP 625 expect: opcode: 15 626 expect: all sections to be empty 627 expect: flag: aa to NOT be present 628 expect: flag: rd to NOT be present 629 expect: flag: ad to NOT be present 630 expect: the OPT record to NOT be present 632 8.1.5. Testing Recursive Queries 634 Ask for the SOA record of the confgured zone. This query is made 635 with only the RD DNS flag bit set and without EDNS. 637 We expect the SOA record for the zone to be returned in the answer 638 section with the rcode set to NOERROR and the AA, QR and RD bits to 639 be set in the response; RA may also be set [RFC1034]. We do not 640 expect an OPT record to be returned [RFC6891]. 642 Check that recursive queries work: 644 dig +noedns +noad +rec soa $zone @$server 646 expect: status: NOERROR 647 expect: the SOA record to be present in the answer section 648 expect: flag: aa to be present 649 expect: flag: rd to be present 650 expect: flag: ad to NOT be present 651 expect: the OPT record to NOT be present 653 8.1.6. Testing TCP 655 Ask for the SOA record of the configured zone. This query is made 656 with no DNS flag bits set and without EDNS. This query is to be sent 657 using TCP. 659 We expect the SOA record for the zone to be returned in the answer 660 section with the rcode set to NOERROR and the AA and QR bits to be 661 set in the response; RA may also be set [RFC1034]. We do not expect 662 an OPT record to be returned [RFC6891]. 664 Check that TCP queries work: 666 dig +noedns +noad +norec +tcp soa $zone @$server 668 expect: status: NOERROR 669 expect: the SOA record to be present in the answer section 670 expect: flag: aa to be present 671 expect: flag: rd to NOT be present 672 expect: flag: ad to NOT be present 673 expect: the OPT record to NOT be present 675 The requirement that TCP be supported is defined in [RFC7766]. 677 8.2. Testing - Extended DNS 679 The next set of tests cover various aspects of EDNS behaviour. If 680 any of these tests succeed (indicating at least some EDNS support) 681 then all of them should succeed. There are servers that support EDNS 682 but fail to handle plain EDNS queries correctly so a plain EDNS query 683 is not a good indicator of lack of EDNS support. 685 8.2.1. Testing Minimal EDNS 687 Ask for the SOA record of the configured zone. This query is made 688 with no DNS flag bits set. EDNS version 0 is used without any EDNS 689 options or EDNS flags set. 691 We expect the SOA record for the zone to be returned in the answer 692 section with the rcode set to NOERROR and the AA and QR bits to be 693 set in the response; RA may also be set [RFC1034]. We expect an OPT 694 record to be returned. There should be no EDNS flags present in the 695 response. The EDNS version field should be 0 and there should be no 696 EDNS options present [RFC6891]. 698 Check that plain EDNS queries work: 700 dig +nocookie +edns=0 +noad +norec soa $zone @$server 702 expect: status: NOERROR 703 expect: the SOA record to be present in the answer section 704 expect: an OPT record to be present in the additional section 705 expect: EDNS Version 0 in response 706 expect: flag: aa to be present 707 expect: flag: ad to NOT be present 709 +nocookie disables sending a EDNS COOKIE option which is otherwise 710 enabled by default in BIND 9.11.0 (and later). 712 8.2.2. Testing EDNS Version Negotiation 714 Ask for the SOA record of a zone the server is nominally configured 715 to serve. This query is made with no DNS flag bits set. EDNS 716 version 1 is used without any EDNS options or EDNS flags set. 718 We expect the SOA record for the zone to NOT be returned in the 719 answer section with the extended rcode set to BADVERS and the QR bit 720 to be set in the response; RA may also be set [RFC1034]. We expect 721 an OPT record to be returned. There should be no EDNS flags present 722 in the response. The EDNS version field should be 0 in the response 723 as no other EDNS version has as yet been specified [RFC6891]. 725 Check that EDNS version 1 queries work (EDNS supported): 727 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 729 expect: status: BADVERS 730 expect: the SOA record to NOT be present in the answer section 731 expect: an OPT record to be present in the additional section 732 expect: EDNS Version 0 in response 733 expect: flag: aa to NOT be present 734 expect: flag: ad to NOT be present 736 +noednsneg has been set as dig supports EDNS version negotiation and 737 we want to see only the response to the initial EDNS version 1 query. 739 8.2.3. Testing Unknown EDNS Options 741 Ask for the SOA record of the configured zone. This query is made 742 with no DNS flag bits set. EDNS version 0 is used without any EDNS 743 flags. An EDNS option is present with a value that has not yet been 744 assigned by IANA. We have picked 100 for the example below. 746 We expect the SOA record for the zone to be returned in the answer 747 section with the rcode set to NOERROR and the AA and QR bits to be 748 set in the response; RA may also be set [RFC1034]. We expect an OPT 749 record to be returned. There should be no EDNS flags present in the 750 response. The EDNS version field should be 0 as EDNS versions other 751 than 0 are yet to be specified and there should be no EDNS options 752 present as unknown EDNS options are supposed to be ignored by the 753 server [RFC6891] Section 6.1.2. 755 Check that EDNS queries with an unknown option work (EDNS supported): 757 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 759 expect: status: NOERROR 760 expect: the SOA record to be present in the answer section 761 expect: an OPT record to be present in the additional section 762 expect: OPT=100 to NOT be present 763 expect: EDNS Version 0 in response 764 expect: flag: aa to be present 765 expect: flag: ad to NOT be present 767 8.2.4. Testing Unknown EDNS Flags 769 Ask for the SOA record of the configured zone. This query is made 770 with no DNS flag bits set. EDNS version 0 is used without any EDNS 771 options. An unassigned EDNS flag bit is set (0x40 in this case). 773 We expect the SOA record for the zone to be returned in the answer 774 section with the rcode set to NOERROR and the AA and QR bits to be 775 set in the response; RA may also be set [RFC1034]. We expect an OPT 776 record to be returned. There should be no EDNS flags present in the 777 response as unknown EDNS flags are supposed to be ignored. The EDNS 778 version field should be 0 and there should be no EDNS options present 779 [RFC6891]. 781 Check that EDNS queries with unknown flags work (EDNS supported): 783 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 785 expect: status: NOERROR 786 expect: the SOA record to be present in the answer section 787 expect: an OPT record to be present in the additional section 788 expect: MBZ not to be present 789 expect: EDNS Version 0 in response 790 expect: flag: aa to be present 791 expect: flag: ad to NOT be present 793 MBZ (Must Be Zero) is a dig-specific indication that a flag bit has 794 been incorrectly copied as per Section 6.1.4, [RFC6891]. 796 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 798 Ask for the SOA record of the configured zone. This query is made 799 with no DNS flag bits set. EDNS version 1 is used without any EDNS 800 options. An unassigned EDNS flag bit is set (0x40 in this case). 802 We expect the SOA record for the zone to NOT be returned in the 803 answer section with the extended rcode set to BADVERS and the QR bit 804 to be set in the response; RA may also be set [RFC1034]. We expect 805 an OPT record to be returned. There should be no EDNS flags present 806 in the response as unknown EDNS flags are supposed to be ignored. 807 The EDNS version field should be 0 as EDNS versions other than 0 are 808 yet to be specified and there should be no EDNS options present 809 [RFC6891]. 811 Check that EDNS version 1 queries with unknown flags work (EDNS 812 supported): 814 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 815 $zone @$server 817 expect: status: BADVERS 818 expect: SOA record to NOT be present 819 expect: an OPT record to be present in the additional section 820 expect: MBZ not to be present 821 expect: EDNS Version 0 in response 822 expect: flag: aa to NOT be present 823 expect: flag: ad to NOT be present 825 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 827 Ask for the SOA record of the configured zone. This query is made 828 with no DNS flag bits set. EDNS version 1 is used. An unknown EDNS 829 option is present. We have picked 100 for the example below. 831 We expect the SOA record for the zone to NOT be returned in the 832 answer section with the extended rcode set to BADVERS and the QR bit 833 to be set in the response; RA may also be set [RFC1034]. We expect 834 an OPT record to be returned. There should be no EDNS flags present 835 in the response. The EDNS version field should be 0 as EDNS versions 836 other than 0 are yet to be specified and there should be no EDNS 837 options present [RFC6891]. 839 Check that EDNS version 1 queries with unknown options work (EDNS 840 supported): 842 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 843 $zone @$server 845 expect: status: BADVERS 846 expect: SOA record to NOT be present 847 expect: an OPT record to be present in the additional section 848 expect: OPT=100 to NOT be present 849 expect: EDNS Version 0 in response 850 expect: flag: aa to be present 851 expect: flag: ad to NOT be present 853 8.2.7. Testing Truncated Responses 855 Ask for the DNSKEY records of the configured zone, which must be a 856 DNSSEC signed zone. This query is made with no DNS flag bits set. 857 EDNS version 0 is used without any EDNS options. The only EDNS flag 858 set is DO. The EDNS UDP buffer size is set to 512. The intention of 859 this query is to elicit a truncated response from the server. Most 860 signed DNSKEY responses are bigger than 512 bytes. This test will 861 not give a valid result if the zone is not signed. 863 We expect a response with the rcode set to NOERROR and the AA and QR 864 bits to be set, AD may be set in the response if the server supports 865 DNSSEC otherwise it should be clear; TC and RA may also be set 866 [RFC1035] [RFC4035]. We expect an OPT record to be present in the 867 response. There should be no EDNS flags other than DO present in the 868 response. The EDNS version field should be 0 and there should be no 869 EDNS options present [RFC6891]. 871 If TC is not set it is not possible to confirm that the server 872 correctly adds the OPT record to the truncated responses or not. 874 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 875 expect: NOERROR 876 expect: OPT record with version set to 0 878 8.2.8. Testing DO=1 Handling 880 Ask for the SOA record of the configured zone, which does not need to 881 be DNSSEC signed. This query is made with no DNS flag bits set. 882 EDNS version 0 is used without any EDNS options. The only EDNS flag 883 set is DO. 885 We expect the SOA record for the zone to be returned in the answer 886 section with the rcode set to NOERROR and the AA and QR bits to be 887 set in the response, AD may be set in the response if the server 888 supports DNSSEC otherwise it should be clear; RA may also be set 889 [RFC1034]. We expect an OPT record to be returned. There should be 890 no EDNS flags other than DO present in the response which should be 891 present if the server supports DNSSEC. The EDNS version field should 892 be 0 and there should be no EDNS options present [RFC6891]. 894 Check that DO=1 queries work (EDNS supported): 896 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 898 expect: status: NOERROR 899 expect: the SOA record to be present in the answer section 900 expect: an OPT record to be present in the additional section 901 expect: DO=1 to be present if a RRSIG is in the response 902 expect: EDNS Version 0 in response 903 expect: flag: aa to be present 905 8.2.9. Testing EDNS Version Negotiation With DO=1 907 Ask for the SOA record of the configured zone, which does not need to 908 be DNSSEC signed. This query is made with no DNS flag bits set. 909 EDNS version 1 is used without any EDNS options. The only EDNS flag 910 set is DO. 912 We expect the SOA record for the zone to NOT be returned in the 913 answer section with the rcode set to BADVERS; the QR bit and possibly 914 the RA bit to be set [RFC1034]. We expect an OPT record to be 915 returned. There should be no EDNS flags other than DO present in the 916 response which should be there if the server supports DNSSEC. The 917 EDNS version field should be 0 and there should be no EDNS options 918 present [RFC6891]. 920 Check that EDNS version 1, DO=1 queries work (EDNS supported): 922 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 923 $zone @$server 925 expect: status: BADVERS 926 expect: SOA record to NOT be present 927 expect: an OPT record to be present in the additional section 928 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 929 returned DO=1 930 expect: EDNS Version 0 in response 931 expect: flag: aa to NOT be present 933 8.2.10. Testing With Multiple Defined EDNS Options 935 Ask for the SOA record of the configured zone. This query is made 936 with no DNS flag bits set. EDNS version 0 is used. A number of 937 defined EDNS options are present (NSID [RFC5001], DNS COOKIE 938 [RFC7873], EDNS Client Subnet [RFC7871] and EDNS Expire [RFC7314]). 940 We expect the SOA record for the zone to be returned in the answer 941 section with the rcode set to NOERROR and the AA and QR bits to be 942 set in the response; RA may also be set [RFC1034]. We expect an OPT 943 record to be returned. There should be no EDNS flags present in the 944 response. The EDNS version field should be 0. Any of the requested 945 EDNS options supported by the server and permitted server 946 configuration may be returned [RFC6891]. 948 Check that EDNS queries with multiple defined EDNS options work: 950 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 951 soa $zone @$server 953 expect: status: NOERROR 954 expect: the SOA record to be present in the answer section 955 expect: an OPT record to be present in the additional section 956 expect: EDNS Version 0 in response 957 expect: flag: aa to be present 958 expect: flag: ad to NOT be present 960 8.3. When EDNS Is Not Supported 962 If EDNS is not supported by the nameserver, we expect a response to 963 each of the above queries. That response may be a FORMERR error 964 response or the OPT record may just be ignored. 966 Some nameservers only return a EDNS response when a particular EDNS 967 option or flag (e.g. DO=1) is present in the request. This 968 behaviour is not compliant behaviour and may hide other incorrect 969 behaviour from the above tests. Re-testing with the triggering 970 option / flag present will expose this misbehaviour. 972 9. Remediation 974 Name server operators are generally expected to test their own 975 infrastructure for compliance to standards. The above tests should 976 be run when new systems are brought online, and should be repeated 977 periodically to ensure continued interoperability. 979 Domain registrants who do not maintain their own DNS infrastructure 980 are entitled to a DNS service that conforms to standards and 981 interoperates well. Registrants who become aware that their DNS 982 operator does not have a well maintained or compliant infrastructure 983 should insist that their service provider correct issues, and switch 984 providers if they do not. 986 In the event that an operator experiences problems due to the 987 behaviour of name servers outside their control, the above tests will 988 help in narrowing down the precise issue(s) which can then be 989 reported to the relevant party. 991 If contact information for the operator of a misbehaving name server 992 is not already known, the following methods of communication could be 993 considered: 995 o the RNAME of the zone authoritative for the name of the 996 misbehaving server 998 o the RNAME of zones for which the offending server is authoritative 1000 o administrative or technical contacts listed in the registration 1001 information for the parent domain of the name of the misbehaving 1002 server, or for zones for which the name server is authoritative 1004 o the registrar or registry for such zones 1006 o DNS-specific operational fora (e.g. mailing lists) 1008 Operators of parent zones may wish to regularly test the 1009 authoritative name servers of their child zones. However, parent 1010 operators can have widely varying capabilities in terms of 1011 notification or remediation depending on whether they have a direct 1012 relationship with the child operator. Many TLD registries, for 1013 example, cannot directly contact their registrants and may instead 1014 need to communicate through the relevant registrar. In such cases 1015 it may be most efficient for registrars to take on the responsibility 1016 for testing the name servers of their registrants, since they have a 1017 direct relationship. 1019 When notification is not effective at correcting problems with a 1020 misbehaving name server, parent operators can choose to remove NS 1021 record sets (and glue records below) that refer to the faulty server. 1022 This should only be done as a last resort and with due consideration, 1023 as removal of a delegation can have unanticipated side effects. For 1024 example, other parts of the DNS tree may depend on names below the 1025 removed zone cut, and the parent operator may find themselves 1026 responsible for causing new DNS failures to occur. 1028 10. Security Considerations 1030 Testing protocol compliance can potentially result in false reports 1031 of attempts to break services from Intrusion Detection Services and 1032 firewalls. All of the tests are well formed (though not necessarily 1033 common) DNS queries. None the tests listed above should cause any 1034 harm to a protocol-compliant server. 1036 Relaxing firewall settings to ensure EDNS compliance could 1037 potentially expose a critical implementation flaw in the nameserver. 1038 Nameservers should be tested for conformance before relaxing firewall 1039 settings. 1041 When removing delegations for non-compliant servers there can be a 1042 knock on effect on other zones that require these zones to be 1043 operational for the nameservers addresses to be resolved. 1045 11. IANA Considerations 1047 There are no actions for IANA. 1049 12. References 1051 12.1. Normative References 1053 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1054 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1055 . 1057 [RFC1035] Mockapetris, P., "Domain names - implementation and 1058 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1059 November 1987, . 1061 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1062 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1063 . 1065 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1066 Rose, "Protocol Modifications for the DNS Security 1067 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1068 . 1070 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1071 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1072 DOI 10.17487/RFC6840, February 2013, 1073 . 1075 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1076 for DNS (EDNS(0))", STD 75, RFC 6891, 1077 DOI 10.17487/RFC6891, April 2013, 1078 . 1080 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1081 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1082 April 2013, . 1084 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1085 D. Wessels, "DNS Transport over TCP - Implementation 1086 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1087 . 1089 12.2. Informative References 1091 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 1092 RFC 2671, DOI 10.17487/RFC2671, August 1999, 1093 . 1095 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record 1096 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 1097 2003, . 1099 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1100 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1101 . 1103 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1104 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1105 . 1107 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1108 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1109 DOI 10.17487/RFC7871, May 2016, 1110 . 1112 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1113 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1114 . 1116 Authors' Addresses 1118 M. Andrews 1119 Internet Systems Consortium 1120 950 Charter Street 1121 Redwood City, CA 94063 1122 US 1124 Email: marka@isc.org 1126 Ray Bellis 1127 Internet Systems Consortium 1128 950 Charter Street 1129 Redwood City, CA 94063 1130 US 1132 Email: ray@isc.org