idnits 2.17.1 draft-ietf-dnsop-no-response-issue-06.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 815 has weird spacing: '...r zones for ...' -- The document date (October 27, 2016) is 2709 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) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Andrews 3 Internet-Draft ISC 4 Intended status: Best Current Practice October 27, 2016 5 Expires: April 30, 2017 7 A Common Operational Problem in DNS Servers - Failure To Respond. 8 draft-ietf-dnsop-no-response-issue-06 10 Abstract 12 The DNS is a query / response protocol. Failure to respond or to 13 respond correctly to queries 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 http://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 April 30, 2017. 41 Copyright Notice 43 Copyright (c) 2016 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 (http://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. DNSSEC . . . . . . . . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . 9 79 7. Response Code Selection . . . . . . . . . . . . . . . . . . . 10 80 8. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 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 Rescursive Queries . . . . . . . . . . . . . 13 87 8.1.6. Testing TCP . . . . . . . . . . . . . . . . . . . . . 14 88 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 14 89 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 14 90 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 14 91 8.2.3. Testing Unknown EDNS Options . . . . . . . . . . . . 15 92 8.2.4. Testing Unknown EDNS Flags . . . . . . . . . . . . . 15 93 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS 94 Flags . . . . . . . . . . . . . . . . . . . . . . . . 16 95 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS 96 Options . . . . . . . . . . . . . . . . . . . . . . . 16 98 8.2.7. Testing DNSSEC Queries . . . . . . . . . . . . . . . 17 99 8.2.8. Testing EDNS Version Negotiation With DNSSEC . . . . 17 100 8.2.9. Testing With Multiple Defined EDNS Options . . . . . 18 101 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 18 102 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 18 103 10. Security Considerations . . . . . . . . . . . . . . . . . . . 20 104 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 105 12. Normative References . . . . . . . . . . . . . . . . . . . . 20 106 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 21 108 1. Introduction 110 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failure 111 to respond to queries or to respond incorrectly causes both immediate 112 operational problems and long term problems with protocol 113 development. 115 Failure to respond to a query is indistinguishable from a packet loss 116 without doing a analysis of query response patterns. Additionally 117 failure to respond results in unnecessary queries being made by DNS 118 clients, and delays being introduced to the resolution process. 120 Due to the inability to distinguish between packet loss and 121 nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes 122 misclassified as lack of EDNS support which can lead to DNSSEC 123 validation failures. 125 Servers which fail to respond to queries results in developers being 126 hesitant to deploy new standards. Such servers need to be 127 identified. 129 The DNS has response codes that cover almost any conceivable query 130 response. A nameserver should be able to respond to any conceivable 131 query using them. There should be no need to drop queries because a 132 nameserver does not understand them. 134 Unless a nameserver is under attack, it should respond to all queries 135 directed to it. Additionally, the nameserver should not assume that 136 there isn't a delegation to the server even if it is not configured 137 to serve the zone. Broken nameservers are a common occurrence in the 138 DNS and receiving queries for zones that the server is not configured 139 for is not necessarily an indication that the server is under attack. 140 Parent zone operators are supposed to regularly check that the 141 delegating NS records are consistent with those of the delegated zone 142 and to correct them when they are not [RFC1034]. Doing this 143 regularly should reduce the instances of broken delegations. 145 When a nameserver is under attack it may wish to drop packets. A 146 common attack is to use a nameserver as a amplifier by sending 147 spoofed packets. This is done because response packets are bigger 148 than the queries and big amplification factors are available 149 especially if EDNS is supported. Limiting the rate of responses is 150 reasonable when this is occurring and the client should retry. This 151 however only works if legitimate clients are not being forced to 152 guess whether EDNS queries are accepted or not. While there is still 153 a pool of servers that don't respond to EDNS requests, clients have 154 no way to know if the lack of response is due to packet loss, EDNS 155 packets not being supported or rate limiting due to the server being 156 under attack. Misclassification of server behaviour is unavoidable 157 when rate limiting is used until the population of servers which fail 158 to respond to well formed queries drops to near zero. 160 2. Consequences 162 Not following the relevant DNS RFCs has multiple adverse 163 consequences. Some resulting directly from the non-compliant 164 behaviour and others as a result of work-arounds forced on recursive 165 servers. Addressing known issues now will reduce future 166 interoperability issues as the DNS protocol continues to evolve and 167 clients make use of newly introduced DNS features. 169 Some examples of known consequences include: 171 o The AD flag bit in a response cannot be trusted to mean anything 172 as many servers incorrectly copied the flag bit from the request 173 to the response despite the prohibition. 175 o Widespread non response to EDNS queries has lead to recursive 176 servers having to assume EDNS may not supported and that fallback 177 to plain DNS is required. Servers get incorrectly diagnosed as 178 not supporting EDNS and when they also serve signed zones DNSSEC 179 validation fails. 181 o Widespread non response to EDNS options, requires recursive 182 servers to have to decide whether to probe to see if it is the 183 EDNS option or just EDNS that is causing the non response. In the 184 limited amount of time required to resolve a query before the 185 client times out this is not possible. 187 o Incorrectly returning FORMERR to a EDNS option being present, 188 leads to the recursive server not being able to determine if the 189 server is just broken in the handling of the EDNS option or 190 doesn't support EDNS at all. 192 o Mishandling of unknown query types has contributed to the 193 abandoning of the transition of the SPF type. 195 o Mishandling of unknown query types has slowed up the development 196 of DANE and and result in additional rules being specified to 197 reduce the probability of interacting with a broken server when 198 making TLSA queries. 200 The consequences of servers not following the RFCs will only grow if 201 measures are not put in place to remove non compliant servers from 202 the ecosystem. Working around issues due to non RFC compliance is 203 not sustainable. 205 Most, if not all, of these consequences could have been avoided if 206 action had been taken to remove non compliant servers as soon as 207 people were aware of them. To actively seek out broken 208 implementations and servers and inform their developers and operators 209 that they need to fix their servers. 211 3. Common queries kinds that result in non responses. 213 There are a number common query kinds that fail to respond today. 214 They are: EDNS queries with and without extensions; queries for 215 unknown (unallocated) or unsupported types; and filtering of TCP 216 queries. 218 3.1. Basic DNS Queries 220 3.1.1. Zone Existence 222 Initially to test existence of the zone, an SOA query should be made. 223 If the SOA record is not returned but some other response is 224 returned, this is a indication of a bad delegation. If the server 225 fails to get a response to a SOA query, the Operator should make an A 226 query for the zone, as some nameservers fail to respond to SOA 227 queries but will respond to A queries. 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. 267 3.1.6. TCP Queries 269 All DNS servers are supposed to respond to queries over TCP 270 [RFC7766]. Firewalls that drop TCP connection attempts, they should 271 reset the connect attempt or send a ICMP/ICMPv6 administratively 272 prohibited message. Dropping TCP connections introduces excessive 273 delays to the resolution process. 275 Whether a server accepts TCP connections can be tested by first 276 checking that it responds to UDP queries to confirm that it is up and 277 operating, then attempting the same query over TCP. An additional 278 query should be made over UDP if the TCP connection attempt fails to 279 confirm that the server under test is still operating. 281 3.2. EDNS Queries 282 3.2.1. EDNS Queries - Version Independent 284 Identifying servers that fail to respond to EDNS queries can be done 285 by first identifying that the server responds to regular DNS queries, 286 followed by a series of otherwise identical queries using EDNS, then 287 making the original query again. A series of EDNS queries is needed 288 as at least one DNS implementation responds to the first EDNS query 289 with FORMERR but fails to respond to subsequent queries from the same 290 address for a period until a regular DNS query is made. The EDNS 291 query should specify a UDP buffer size of 512 bytes to avoid false 292 classification of not supporting EDNS due to response packet size. 294 If the server responds to the first and last queries but fails to 295 respond to most or all of the EDNS queries, it is probably faulty. 296 The test should be repeated a number of times to eliminate the 297 likelihood of a false positive due to packet loss. 299 Firewalls may also block larger EDNS responses but there is no easy 300 way to check authoritative servers to see if the firewall is mis- 301 configured. 303 3.2.2. EDNS Queries - Version Specific 305 Some servers respond correctly to EDNS version 0 queries but fail to 306 respond to EDNS queries with version numbers that are higher than 307 zero. Servers should respond with BADVERS to EDNS queries with 308 version numbers that they do not support. 310 Some servers respond correctly to EDNS version 0 queries but fail to 311 set QR=1 when responding to EDNS versions they do not support. Such 312 answers are discarded or treated as requests. 314 3.2.3. EDNS Options 316 Some servers fail to respond to EDNS queries with EDNS options set. 317 Unknown EDNS options are supposed to be ignored by the server 318 [RFC6891]. 320 3.2.4. EDNS Flags 322 Some servers fail to respond to EDNS queries with EDNS flags set. 323 Server should ignore EDNS flags they do not understand and should not 324 add them to the response [RFC6891]. 326 3.2.5. Truncated EDNS Responses 328 Some EDNS aware servers fail to include a OPT record when a truncated 329 response is sent. A OPT record is supposed to be included in a 330 truncated response [RFC6891]. 332 Some EDNS aware server fail to honour the advertised EDNS buffer size 333 and send over sized responses. 335 3.2.6. DNSSEC 337 Servers should be checked to see if they support DNSSEC. Servers 338 should also be checked to see if they support DNSSEC with EDNS. 340 3.2.7. EDNS over TCP 342 Some EDNS aware servers incorrectly limit the TCP response sizes to 343 the advertised UDP response size. 345 4. Firewalls and Load Balancers 347 Firewalls and load balancers can affect the externally visible 348 behaviour of a nameserver. Tests for conformance should to be done 349 from outside of any firewall so that the system as a whole is tested. 351 Firewalls and load balancers should not drop DNS packets that they 352 don't understand. They should either pass the packets or generate an 353 appropriate error response. 355 Requests for unknown query types is normal client behaviour and 356 should not be construed as an attack. Nameservers have always been 357 expected to be able to handle such queries. 359 Requests for unknown query classes is normal client behaviour and 360 should not be construed as an attack. Nameservers have always been 361 expected to be able to handle such queries. 363 Requests with unknown opcodes is normal client behaviour and should 364 not be construed as an attack. Nameservers have always been expected 365 to be able to handle such queries. 367 Requests with unassigned flags set (DNS or EDNS) is expected client 368 behaviour and should not be construed as an attack. The behaviour 369 for unassigned flags is to ignore them in the request and to not set 370 them in the response. Dropping DNS / EDNS packets with unassigned 371 flags makes it difficult to deploy extensions that make use of them 372 due to the need to reconfigure and update firewalls. 374 Requests with unknown EDNS options is expected client behaviour and 375 should not be construed as an attack. The correct behaviour for 376 unknown EDNS options is to ignore there presence when constructing a 377 reply. 379 Requests with unknown EDNS versions is expected client behaviour and 380 should not be construed as an attack. The correct behaviour for 381 unknown EDNS versions is to return BADVERS along with the highest 382 EDNS version the server supports. Dropping EDNS packet breaks EDNS 383 version negotiation. 385 Firewalls should not assume that there will only be a single response 386 message to a requests. There have been proposals to use EDNS to 387 signal that multiple DNS messages be returned rather than a single 388 UDP message that is fragmented at the IP layer. 390 However, there may be times when a nameserver mishandles messages 391 with a particular flag, EDNS option, EDNS version field, opcode, type 392 or class field or combination there of to the point where the 393 integrity of the nameserver is compromised. Firewalls should offer 394 the ability to selectively reject messages with an appropriately 395 constructed response based on all these fields while awaiting a fix 396 from the nameserver vendor. 398 DNS and EDNS in particular is designed to allow clients to be able to 399 use new features against older servers without having to validate 400 every option. Indiscriminate blocking of messages breaks that 401 design. 403 5. Scrubbing Services 405 Scrubbing services, like firewalls, can affect the externally visible 406 behaviour of a nameserver. If a operator uses a scrubbing service, 407 they should check that legitimate queries are not being blocked. 409 Scrubbing services, unlike firewalls, are also turned on and off in 410 response to denial of service attacks. One needs to take care when 411 choosing a scrubbing service and ask questions like mentioned above. 413 Ideally, Operators should run these tests against a scrubbing service 414 to ensure that these tests are not seen as attack vectors. 416 6. Whole Answer Caches 418 Whole answer caches take a previously constructed answer and return 419 it to a subsequent query for the same qname, qtype and qclass, just 420 updating the query id field and possibly the qname to match the 421 incoming query to avoid constructing each response individually. 423 Whole answer caches can return the wrong response to a query if they 424 do not take all of the attributes of the query into account, rather 425 than just some of them e.g. qname, qtype and qclass. This has 426 implications when testing and with overall protocol compliance. 428 Two current examples are: 430 o Whole answer caches that ignore the EDNS version field which 431 results in incorrect answers to non EDNS version 0 queries being 432 returned if they were preceded by a EDNS version 0 query for the 433 same name and type. 435 o Whole answer caches that ignore the EDNS options in the query 436 resulting in options only working some of the time and/or options 437 being returned when not requested. 439 7. Response Code Selection 441 Choosing the correct response code when responding to DNS queries is 442 important. Just because a DNS qtype is not implemented does not mean 443 that NOTIMP is the correct response code to return. Response codes 444 should be chosen considering how clients will handle them. 446 For unimplemented opcodes NOTIMP is the expected response code. For 447 example, a new opcode could change the message format by extending 448 the header or changing the structure of the records etc. This may 449 result in FORMERR being returned though NOTIMP would be more correct. 451 Unimplemented type codes, Name Error (NXDOMAIN) and NOERROR (no data) 452 are the expected response codes. A server is not supposed to serve a 453 zone which contains unsupported types ([RFC1034]) so the only thing 454 left is return if the QNAME exists or not. NOTIMP and REFUSED are 455 not useful responses as they force the clients to try the other 456 authoritative servers for a zone looking for a server which will 457 answer the query. 459 Meta queries may be the exception but these need to be thought about 460 on a case by case basis. 462 If the server supports EDNS and receives a query with an unsupported 463 EDNS version, the correct response is BADVERS [RFC6891]. 465 If the server does not support EDNS at all, FORMERR and NOTIMP are 466 the expected error codes. That said a minimal EDNS server 467 implementation requires parsing the OPT records and responding with 468 an empty OPT record. There is no need to interpret any EDNS options 469 present in the request as unsupported EDNS options are expected to be 470 ignored [RFC6891]. 472 8. Testing 474 Testing is divided into two sections. Basic DNS which all servers 475 should meet and Extended DNS which should be met by all servers that 476 support EDNS (a server is deemed to support EDNS if it gives a valid 477 EDNS response to any EDNS query). If a server does not support EDNS 478 it should still respond to all the tests. 480 It is advisable to run all of the tests below in parallel so as to 481 minimise the delays due to multiple timeouts when the servers do not 482 respond. There are 16 queries directed to each nameserver assuming 483 no packet loss testing different aspects of Basic DNS and EDNS. 485 The tests below use dig from BIND 9.11.0. 487 8.1. Testing - Basic DNS 489 This first set of tests cover basic DNS server behaviour and all 490 servers should pass these tests. 492 8.1.1. Is The Server Configured For The Zone? 494 Verify the server is configured for the zone: 496 dig +noedns +noad +norec soa $zone @$server 498 expect: status: NOERROR 499 expect: the SOA record to be present in the answer section 500 expect: flag: aa to be present 501 expect: flag: ad to NOT be present 502 expect: the OPT record to NOT be present 504 8.1.2. Testing Unknown Types? 505 Check that queries for an unknown type work: 507 dig +noedns +noad +norec type1000 $zone @$server 509 expect: status: NOERROR 510 expect: an empty answer section. 511 expect: flag: aa to be present 512 expect: flag: ad to NOT be present 513 expect: the OPT record to NOT be present 515 That new types are to be expected is specified in Section 3.6, 516 [RFC1035]. Servers that don't support a new type are expected to 517 reject a zone that contains a unsupported type as per Section 5.2, 518 [RFC1035]. This means that a server that does load a zone can answer 519 questions for unknown types with NOERROR or NXDOMAIN as per 520 Section 4.3.2, [RFC1034]. [RFC6895] later reserved distinct ranges 521 for meta and data types which allows servers to be definitive about 522 whether a query should be answerable from zone content or not. 524 8.1.3. Testing Header Bits 526 8.1.3.1. Testing CD=1 Queries 528 Check that queries with CD=1 work: 530 dig +noedns +noad +norec +cd soa $zone @$server 532 expect: status: NOERROR 533 expect: the SOA record to be present in the answer section 534 expect: flag: aa to be present 535 expect: flag: ad to NOT be present 536 expect: the OPT record to NOT be present 538 CD use in queries is defined in [RFC4035]. 540 8.1.3.2. Testing AD=1 Queries 542 Check that queries with AD=1 work: 544 dig +noedns +norec +ad soa $zone @$server 546 expect: status: NOERROR 547 expect: the SOA record to be present in the answer section 548 expect: flag: aa to be present 549 expect: flag: ad to NOT be present 550 expect: the OPT record to NOT be present 552 AD use in queries is defined in [RFC6840]. 554 8.1.3.3. Testing Reserved Bit 556 Check that queries with the last unassigned DNS header flag work and 557 that the flag bit is not copied to the response: 559 dig +noedns +noad +norec +zflag soa $zone @$server 561 expect: status: NOERROR 562 expect: the SOA record to be present in the answer section 563 expect: MBZ to NOT be in the response 564 expect: flag: aa to be present 565 expect: flag: ad to NOT be present 566 expect: the OPT record to NOT be present 568 MBZ (Must Be Zero) presence indicates the flag bit has been 569 incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved for 570 future use. Must be zero in all queries and responses." 572 8.1.4. Testing Unknown Opcodes 574 Check that new opcodes are handled: 576 dig +noedns +noad +opcode=15 +norec +header-only @$server 578 expect: status: NOTIMP 579 expect: SOA record to NOT be present 580 expect: flag: aa to NOT be present 581 expect: flag: ad to NOT be present 582 expect: the OPT record to NOT be present 584 As unknown opcodes have no definition, including packet format other 585 than there must be a DNS header present, there is only one possible 586 rcode that make sense to return to a request with a unknown opcode 587 and that is NOTIMP. 589 8.1.5. Testing Rescursive Queries 591 Check that recursive queries work: 593 dig +noedns +noad +rec soa $zone @$server 595 expect: status: NOERROR 596 expect: the SOA record to be present in the answer section 597 expect: flag: aa to be present 598 expect: flag: ad to NOT be present 599 expect: flag: rd to be present 600 expect: the OPT record to NOT be present 602 8.1.6. Testing TCP 604 Check that TCP queries work: 606 dig +noedns +noad +norec +tcp soa $zone @$server 608 expect: status: NOERROR 609 expect: the SOA record to be present in the answer section 610 expect: flag: aa to be present 611 expect: flag: ad to NOT be present 612 expect: the OPT record to NOT be present 614 The requirement that TCP be supported is defined in [RFC7766]. 616 8.2. Testing - Extended DNS 618 The next set of test cover various aspects of EDNS behaviour. If any 619 of these tests succeed, then all of them should succeed. There are 620 servers that support EDNS but fail to handle plain EDNS queries 621 correctly so a plain EDNS query is not a good indicator of lack of 622 EDNS support. 624 8.2.1. Testing Minimal EDNS 626 Check that plain EDNS queries work: 628 dig +nocookie +edns=0 +noad +norec soa $zone @$server 630 expect: status: NOERROR 631 expect: the SOA record to be present in the answer section 632 expect: a OPT record to be present in the additional section 633 expect: EDNS Version 0 in response 634 expect: flag: aa to be present 635 expect: flag: ad to NOT be present 637 +nocookie disables sending a EDNS COOKIE option in which is on by 638 default. 640 8.2.2. Testing EDNS Version Negotiation 641 Check that EDNS version 1 queries work (EDNS supported): 643 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 645 expect: status: BADVERS 646 expect: the SOA record to NOT be present in the answer section 647 expect: a OPT record to be present in the additional section 648 expect: EDNS Version 0 in response 649 expect: flag: aa to NOT be present 650 expect: flag: ad to NOT be present 652 Only EDNS Version 0 is currently defined so the response should 653 always be a 0 version. This will change when EDNS version 1 is 654 defined. BADVERS is the expected rcode if EDNS is supported as per 655 Section 6.1.3, [RFC6891]. 657 8.2.3. Testing Unknown EDNS Options 659 Check that EDNS queries with an unknown option work (EDNS supported): 661 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 663 expect: status: NOERROR 664 expect: the SOA record to be present in the answer section 665 expect: a OPT record to be present in the additional section 666 expect: OPT=100 to NOT be present 667 expect: EDNS Version 0 in response 668 expect: flag: aa to be present 669 expect: flag: ad to NOT be present 671 Unknown EDNS options are supposed to be ignored, Section 6.1.2, 672 [RFC6891]. 674 8.2.4. Testing Unknown EDNS Flags 675 Check that EDNS queries with unknown flags work (EDNS supported): 677 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 679 expect: status: NOERROR 680 expect: the SOA record to be present in the answer section 681 expect: a OPT record to be present in the additional section 682 expect: MBZ not to be present 683 expect: EDNS Version 0 in response 684 expect: flag: aa to be present 685 expect: flag: ad to NOT be present 687 MBZ (Must Be Zero) presence indicates the flag bit has been 688 incorrectly copied as per Section 6.1.4, [RFC6891]. 690 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 692 Check that EDNS version 1 queries with unknown flags work (EDNS 693 supported): 695 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 696 $zone @$server 698 expect: status: BADVERS 699 expect: SOA record to NOT be present 700 expect: a OPT record to be present in the additional section 701 expect: MBZ not to be present 702 expect: EDNS Version 0 in response 703 expect: flag: aa to NOT be present 704 expect: flag: ad to NOT be present 706 +noednsneg disables EDNS version negotiation in DiG; MBZ (Must Be 707 Zero) presence indicates the flag bit has been incorrectly copied. 709 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 710 Check that EDNS version 1 queries with unknown options work (EDNS 711 supported): 713 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 714 $zone @$server 716 expect: status: BADVERS 717 expect: SOA record to NOT be present 718 expect: a OPT record to be present in the additional section 719 expect: OPT=100 to NOT be present 720 expect: EDNS Version 0 in response 721 expect: flag: aa to be present 722 expect: flag: ad to NOT be present 724 +noednsneg disables EDNS version negotiation in DiG. 726 8.2.7. Testing DNSSEC Queries 728 Check that a DNSSEC queries work (EDNS supported): 730 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 732 expect: status: NOERROR 733 expect: the SOA record to be present in the answer section 734 expect: a OPT record to be present in the additional section 735 expect: DO=1 to be present if a RRSIG is in the response 736 expect: EDNS Version 0 in response 737 expect: flag: aa to be present 739 DO=1 should be present if RRSIGs are returned as they indicate that 740 the server supports DNSSEC. Servers that support DNSSEC are supposed 741 to copy the DO bit from the request to the response as per [RFC3225]. 743 8.2.8. Testing EDNS Version Negotiation With DNSSEC 744 Check that EDNS version 1 DNSSEC queries work (EDNS supported): 746 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 747 $zone @$server 749 expect: status: BADVERS 750 expect: SOA record to NOT be present 751 expect: a OPT record to be present in the additional section 752 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 753 returned DO=1 754 expect: EDNS Version 0 in response 755 expect: flag: aa to NOT be present 757 +noednsneg disables EDNS version negotiation in DiG. 759 8.2.9. Testing With Multiple Defined EDNS Options 761 Check that EDNS queries with multiple defined EDNS options work: 763 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 764 soa $zone @$server 766 expect: status: NOERROR 767 expect: the SOA record to be present in the answer section 768 expect: a OPT record to be present in the additional section 769 expect: EDNS Version 0 in response 770 expect: flag: aa to be present 771 expect: flag: ad to NOT be present 773 8.3. When EDNS Is Not Supported 775 If EDNS is not supported by the nameserver, we expect a response to 776 all the above queries. That response may be a FORMERR or NOTIMP 777 error response or the OPT record may just be ignored. 779 Some nameservers only return a EDNS response when a particular EDNS 780 option or flag (e.g. DO=1) is present in the request. This 781 behaviour is not compliant behaviour and may hide other incorrect 782 behaviour from the above tests. Re-testing with the triggering 783 option / flag present will expose this misbehaviour. 785 9. Remediation 787 Name server operators are generally expected to test their own 788 infrastructure for compliance to standards. The above tests should 789 be run when new systems are brought online, and should be repeated 790 periodically to ensure continued interoperability. 792 Domain registrants who do not maintain their own DNS infrastructure 793 are entitled to a DNS service that conforms to standards and 794 interoperates well. Registrants who become aware that their DNS 795 operator does not have a well maintained or compliant infrastructure 796 should insist that their service provider correct issues, and switch 797 providers if they do not. 799 In the event that an operator experiences problems due to the 800 behaviour of name servers outside their control, the above tests will 801 help in narrowing down the precise issue(s) which can then be 802 reported to the relevant party. 804 If contact information for the operator of a misbehaving name server 805 is not already known, the following methods of communication could be 806 considered: 808 o the RNAME of the zone authoritative for the name of the 809 misbehaving server 811 o the RNAME of zones for which the offending server is authoritative 813 o administrative or technical contacts listed in the registration 814 information for the parent domain of the name of the misbehaving 815 server, or for zones for which the name server is authoritative 817 o the registrar or registry for such zones 819 o DNS-specific operational fora (e.g. mailing lists) 821 Operators of parent zones may wish to regularly test the 822 authoritative name servers of their child zones. However, parent 823 operators can have widely varying capabilities in terms of 824 notification or remediation depending on whether they have a direct 825 relationship with the child operator. Many TLD registries, for 826 example, cannot directly contact their registrants and may instead 827 need to communicate through the relevant registrar. In such cases 828 it may be most efficient for registrars to take on the responsibility 829 for testing the name servers of their registrants, since they have a 830 direct relationship. 832 When notification is not effective at correcting problems with a 833 misbehaving name server, parent operators can choose to remove NS 834 record sets (and glue records below) that refer to the faulty server. 835 This should only be done as a last resort and with due consideration, 836 as removal of a delegation can have unanticipated side effects. For 837 example, other parts of the DNS tree may depend on names below the 838 removed zone cut, and the parent operator may find themselves 839 responsible for causing new DNS failures to occur. 841 10. Security Considerations 843 Testing protocol compliance can potentially result in false reports 844 of attempts to break services from Intrusion Detection Services and 845 firewalls. None of the tests listed above should break nominally 846 EDNS compliant servers. None of the tests above should break non 847 EDNS servers. All the tests above are well formed, though not 848 necessarily common, DNS queries. 850 Relaxing firewall settings to ensure EDNS compliance could 851 potentially expose a critical implementation flaw in the nameserver. 852 Nameservers should be tested for conformance before relaxing firewall 853 settings. 855 When removing delegations for non-compliant servers there can be a 856 knock on effect on other zones that require these zones to be 857 operational for the nameservers addresses to be resolved. 859 11. IANA Considerations 861 There are no actions for IANA. 863 12. Normative References 865 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 866 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 867 . 869 [RFC1035] Mockapetris, P., "Domain names - implementation and 870 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 871 November 1987, . 873 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 874 RFC 3225, DOI 10.17487/RFC3225, December 2001, 875 . 877 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 878 Rose, "Protocol Modifications for the DNS Security 879 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 880 . 882 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 883 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 884 DOI 10.17487/RFC6840, February 2013, 885 . 887 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 888 for DNS (EDNS(0))", STD 75, RFC 6891, 889 DOI 10.17487/RFC6891, April 2013, 890 . 892 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 893 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 894 April 2013, . 896 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 897 D. Wessels, "DNS Transport over TCP - Implementation 898 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 899 . 901 Author's Address 903 M. Andrews 904 Internet Systems Consortium 905 950 Charter Street 906 Redwood City, CA 94063 907 US 909 Email: marka@isc.org