idnits 2.17.1 draft-ietf-dnsop-no-response-issue-08.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 1050 has weird spacing: '...r zones for ...' -- The document date (March 3, 2017) is 2611 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 March 3, 2017 5 Expires: September 4, 2017 7 A Common Operational Problem in DNS Servers - Failure To Respond. 8 draft-ietf-dnsop-no-response-issue-08 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 September 4, 2017. 41 Copyright Notice 43 Copyright (c) 2017 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 . . . . . . . . . . . . . . . . . . . . . . 7 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 . . . . . . . . . . . . . . . 14 86 8.1.5. Testing Recursive Queries . . . . . . . . . . . . . . 15 87 8.1.6. Testing TCP . . . . . . . . . . . . . . . . . . . . . 15 88 8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 16 89 8.2.1. Testing Minimal EDNS . . . . . . . . . . . . . . . . 16 90 8.2.2. Testing EDNS Version Negotiation . . . . . . . . . . 16 91 8.2.3. Testing Unknown EDNS Options . . . . . . . . . . . . 17 92 8.2.4. Testing Unknown EDNS Flags . . . . . . . . . . . . . 18 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 . . . . . . . . . . . . . 20 99 8.2.8. Testing DNSSEC Queries . . . . . . . . . . . . . . . 20 100 8.2.9. Testing EDNS Version Negotiation With DNSSEC . . . . 21 101 8.2.10. Testing With Multiple Defined EDNS Options . . . . . 22 102 8.3. When EDNS Is Not Supported . . . . . . . . . . . . . . . 22 103 9. Remediation . . . . . . . . . . . . . . . . . . . . . . . . . 22 104 10. Security Considerations . . . . . . . . . . . . . . . . . . . 24 105 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 106 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 107 12.1. Normative References . . . . . . . . . . . . . . . . . . 24 108 12.2. Informative References . . . . . . . . . . . . . . . . . 25 109 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 25 111 1. Introduction 113 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failure 114 to respond to queries or to respond incorrectly causes both immediate 115 operational problems and long term problems with protocol 116 development. 118 Failure to respond to a query is indistinguishable from a packet loss 119 without doing a analysis of query response patterns. Additionally 120 failure to respond results in unnecessary queries being made by DNS 121 clients, and delays being introduced 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 Servers which fail to respond to queries results in developers being 129 hesitant to deploy new standards. Such servers need to be 130 identified. 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. Additionally, the nameserver should not assume that 139 there isn't a delegation to the server even if it is not configured 140 to serve the zone. Broken nameservers are a common occurrence in the 141 DNS and receiving queries for zones that the server is not configured 142 for is not necessarily an indication that the server is under attack. 143 Parent zone operators are supposed to regularly check that the 144 delegating NS records are consistent with those of the delegated zone 145 and to correct them when they are not [RFC1034]. Doing this 146 regularly should reduce the instances of broken delegations. 148 When a nameserver is under attack it may wish to drop packets. A 149 common attack is to use a nameserver as a amplifier by sending 150 spoofed packets. This is done because response packets are bigger 151 than the queries and big amplification factors are available 152 especially if EDNS is supported. Limiting the rate of responses is 153 reasonable when this is occurring and the client should retry. This 154 however only works if legitimate clients are not being forced to 155 guess whether EDNS queries are accepted or not. While there is still 156 a pool of servers that don't respond to EDNS requests, clients have 157 no way to know if the lack of response is due to packet loss, EDNS 158 packets not being supported or rate limiting due to the server being 159 under attack. Misclassification of server behaviour is unavoidable 160 when rate limiting is used until the population of servers which fail 161 to respond to well formed queries drops to near zero. 163 2. Consequences 165 Not following the relevant DNS RFCs has multiple adverse 166 consequences. Some resulting directly from the non-compliant 167 behaviour and others as a result of work-arounds forced on recursive 168 servers. Addressing known issues now will reduce future 169 interoperability issues as the DNS protocol continues to evolve and 170 clients make use of newly introduced DNS features. 172 Some examples of known consequences include: 174 o The AD flag bit in a response cannot be trusted to mean anything 175 as many servers incorrectly copied the flag bit from the request 176 to the response despite the prohibition. 178 o Widespread non response to EDNS queries has lead to recursive 179 servers having to assume EDNS may not supported and that fallback 180 to plain DNS is required. Servers get incorrectly diagnosed as 181 not supporting EDNS and when they also serve signed zones DNSSEC 182 validation fails. 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 and result in additional rules being specified to 200 reduce the probability of interacting with a broken server when 201 making 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 RFC compliance is 206 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. 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 made. 226 If the SOA record is not returned but some other response is 227 returned, this is a indication of a bad delegation. If the server 228 fails to get a response to a SOA query, the Operator should make an A 229 query for the zone, as some nameservers fail to respond to SOA 230 queries but will respond to A queries. 232 3.1.2. Unknown / Unsupported Type Queries 234 Identifying servers that fail to respond to unknown or unsupported 235 types can be done by making an initial DNS query for an A record, 236 making a number of queries for an unallocated type, then making a 237 query for an A record again. IANA maintains a registry of allocated 238 types. 240 If the server responds to the first and last queries but fails to 241 respond to the queries for the unallocated type, it is probably 242 faulty. The test should be repeated a number of times to eliminate 243 the likelihood of a false positive due to packet loss. 245 3.1.3. DNS Flags 247 Some servers fail to respond to DNS queries with various DNS flags 248 set, regardless of whether they are defined or still reserved. At 249 the time of writing there are servers that fail to respond to queries 250 with the AD bit set to 1 and servers that fail to respond to queries 251 with the last reserved flag bit set. 253 3.1.4. Unknown DNS opcodes 255 The use of previously undefined opcodes is to be expected. Since the 256 DNS was first defined two new opcodes have been added, UPDATE and 257 NOTIFY. 259 NOTIMP is the expected rcode to an unknown or unimplemented opcode. 261 Note: while new opcodes will most probably use the current layout 262 structure for the rest of the message there is no requirement that 263 anything other than the DNS header match. 265 3.1.5. Recursive Queries 267 A non-recursive server is supposed to respond to recursive queries as 268 if the RD bit is not set. 270 3.1.6. TCP Queries 272 All DNS servers are supposed to respond to queries over TCP 273 [RFC7766]. Firewalls that drop TCP connection attempts, they should 274 reset the connect attempt or send a ICMP/ICMPv6 administratively 275 prohibited message. Dropping TCP connections introduces excessive 276 delays to the resolution process. 278 Whether a server accepts TCP connections can be tested by first 279 checking that it responds to UDP queries to confirm that it is up and 280 operating, then attempting the same query over TCP. An additional 281 query should be made over UDP if the TCP connection attempt fails to 282 confirm that the server under test is still operating. 284 3.2. EDNS Queries 286 3.2.1. EDNS Queries - Version Independent 288 Identifying servers that fail to respond to EDNS queries can be done 289 by first identifying 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]. 324 3.2.4. EDNS Flags 326 Some servers fail to respond to EDNS queries with EDNS flags set. 327 Server should ignore EDNS flags they do not understand and should not 328 add them to the response [RFC6891]. 330 3.2.5. Truncated EDNS Responses 332 Some EDNS aware servers fail to include a OPT record when a truncated 333 response is sent. A OPT record is supposed to be included in a 334 truncated response [RFC6891]. 336 Some EDNS aware server fail to honour the advertised EDNS buffer size 337 and send over sized responses. 339 3.2.6. DNSSEC 341 Servers should be checked to see if they support DNSSEC. Servers 342 should also be checked to see if they support DNSSEC with EDNS. 344 3.2.7. EDNS over TCP 346 Some EDNS aware servers incorrectly limit the TCP response sizes to 347 the advertised UDP response size. 349 4. Firewalls and Load Balancers 351 Firewalls and load balancers can affect the externally visible 352 behaviour of a nameserver. Tests for conformance should to be done 353 from outside of any firewall so that the system as a whole is tested. 355 Firewalls and load balancers should not drop DNS packets that they 356 don't understand. They should either pass the packets or generate an 357 appropriate error response. 359 Requests for unknown query types 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 for unknown query classes is normal client behaviour and 364 should not be construed as an attack. Nameservers have always been 365 expected to be able to handle such queries. 367 Requests with unknown opcodes is normal client behaviour and should 368 not be construed as an attack. Nameservers have always been expected 369 to be able to handle such queries. 371 Requests with unassigned flags set (DNS or EDNS) is expected client 372 behaviour and should not be construed as an attack. The behaviour 373 for unassigned flags is to ignore them in the request and to not set 374 them in the response. Dropping DNS / EDNS packets with unassigned 375 flags makes it difficult to deploy extensions that make use of them 376 due to the need to reconfigure and update firewalls. 378 Requests with unknown EDNS options is expected client behaviour and 379 should not be construed as an attack. The correct behaviour for 380 unknown EDNS options is to ignore there presence when constructing a 381 reply. 383 Requests with unknown EDNS versions is expected client behaviour and 384 should not be construed as an attack. The correct behaviour for 385 unknown EDNS versions is to return BADVERS along with the highest 386 EDNS version the server supports. Dropping EDNS packet breaks EDNS 387 version negotiation. 389 Firewalls should not assume that there will only be a single response 390 message to a requests. There have been proposals to use EDNS to 391 signal that multiple DNS messages be returned rather than a single 392 UDP message that is fragmented at the IP layer. 394 However, there may be times when a nameserver mishandles messages 395 with a particular flag, EDNS option, EDNS version field, opcode, type 396 or class field or combination there of to the point where the 397 integrity of the nameserver is compromised. Firewalls should offer 398 the ability to selectively reject messages with an appropriately 399 constructed response based on all these fields while awaiting a fix 400 from the nameserver vendor. 402 DNS and EDNS in particular is designed to allow clients to be able to 403 use new features against older servers without having to validate 404 every option. Indiscriminate blocking of messages breaks that 405 design. 407 5. Scrubbing Services 409 Scrubbing services, like firewalls, can affect the externally visible 410 behaviour of a nameserver. If a operator uses a scrubbing service, 411 they should check that legitimate queries are not being blocked. 413 Scrubbing services, unlike firewalls, are also turned on and off in 414 response to denial of service attacks. One needs to take care when 415 choosing a scrubbing service and ask questions like mentioned above. 417 Ideally, Operators should run these tests against a scrubbing service 418 to ensure that these tests are not seen as attack vectors. 420 6. Whole Answer Caches 422 Whole answer caches take a previously constructed answer and return 423 it to a subsequent query for the same qname, qtype and qclass, just 424 updating the query id field and possibly the qname to match the 425 incoming query to avoid constructing each response individually. 427 Whole answer caches can return the wrong response to a query if they 428 do not take all of the attributes of the query into account, rather 429 than just some of them e.g. qname, qtype and qclass. This has 430 implications when testing and with overall protocol compliance. 432 Two current examples are: 434 o Whole answer caches that ignore the EDNS version field which 435 results in incorrect answers to non EDNS version 0 queries being 436 returned if they were preceded by a EDNS version 0 query for the 437 same name and type. 439 o Whole answer caches that ignore the EDNS options in the query 440 resulting in options only working some of the time and/or options 441 being returned when not requested. 443 7. Response Code Selection 445 Choosing the correct response code when responding to DNS queries is 446 important. Just because a DNS qtype is not implemented does not mean 447 that NOTIMP is the correct response code to return. Response codes 448 should be chosen considering how clients will handle them. 450 For unimplemented opcodes NOTIMP is the expected response code. For 451 example, a new opcode could change the message format by extending 452 the header or changing the structure of the records etc. This may 453 result in FORMERR being returned though NOTIMP would be more correct. 455 Unimplemented type codes, Name Error (NXDOMAIN) and NOERROR (no data) 456 are the expected response codes. A server is not supposed to serve a 457 zone which contains unsupported types ([RFC1034]) so the only thing 458 left is return if the QNAME exists or not. NOTIMP and REFUSED are 459 not useful responses as they force the clients to try the other 460 authoritative servers for a zone looking for a server which will 461 answer the query. 463 Meta queries may be the exception but these need to be thought about 464 on a case by case basis. 466 If the server supports EDNS and receives a query with an unsupported 467 EDNS version, the correct response is BADVERS [RFC6891]. 469 If the server does not support EDNS at all, FORMERR and NOTIMP are 470 the expected error codes. That said a minimal EDNS server 471 implementation requires parsing the OPT records and responding with 472 an empty OPT record. There is no need to interpret any EDNS options 473 present in the request as unsupported EDNS options are expected to be 474 ignored [RFC6891]. 476 8. Testing 478 Testing is divided into two sections. Basic DNS which all servers 479 should meet and Extended DNS which should be met by all servers that 480 support EDNS (a server is deemed to support EDNS if it gives a valid 481 EDNS response to any EDNS query). If a server does not support EDNS 482 it should still respond to all the tests. 484 It is advisable to run all of the tests below in parallel so as to 485 minimise the delays due to multiple timeouts when the servers do not 486 respond. There are 16 queries directed to each nameserver assuming 487 no packet loss testing different aspects of Basic DNS and EDNS. 489 The tests below use dig from BIND 9.11.0. 491 8.1. Testing - Basic DNS 493 This first set of tests cover basic DNS server behaviour and all 494 servers should pass these tests. 496 8.1.1. Is The Server Configured For The Zone? 498 Ask for the SOA record of the zone the server is nominally configured 499 to serve. This query is made with no DNS flag bits set and without 500 EDNS. 502 We expect the SOA record for the zone to be returned in the answer 503 section with the rcode set to NOERROR and the AA and QR bits to be 504 set in the response, RA may also be set [RFC1034]. We do not expect 505 a OPT record to be returned [RFC6891]. 507 Verify the server is configured for the zone: 509 dig +noedns +noad +norec soa $zone @$server 511 expect: status: NOERROR 512 expect: the SOA record to be present in the answer section 513 expect: flag: aa to be present 514 expect: flag: rd to NOT be present 515 expect: flag: ad to NOT be present 516 expect: the OPT record to NOT be present 518 8.1.2. Testing Unknown Types 520 Ask for the TYPE1000 record at the zone's name. This query is made 521 with no DNS flag bits set and without EDNS. TYPE1000 has been chosen 522 for this purpose as IANA is unlikely to allocate this type in the 523 near future and it is not in type space reserved for end user 524 allocation. 526 We don't expect any records to be returned in the answer section with 527 the rcode set to NOERROR and the AA and QR bits to be set in the 528 response, RA may also be set [RFC1034]. We do not expect a OPT 529 record to be returned [RFC6891]. 531 Check that queries for an unknown type work: 533 dig +noedns +noad +norec type1000 $zone @$server 535 expect: status: NOERROR 536 expect: an empty answer section. 537 expect: flag: aa to be present 538 expect: flag: rd to NOT be present 539 expect: flag: ad to NOT be present 540 expect: the OPT record to NOT be present 542 That new types are to be expected is specified in Section 3.6, 543 [RFC1035]. Servers that don't support a new type are expected to 544 reject a zone that contains a unsupported type as per Section 5.2, 545 [RFC1035]. This means that a server that does load a zone can answer 546 questions for unknown types with NOERROR or NXDOMAIN as per 547 Section 4.3.2, [RFC1034]. [RFC6895] later reserved distinct ranges 548 for meta and data types which allows servers to be definitive about 549 whether a query should be answerable from zone content or not. 551 8.1.3. Testing Header Bits 553 8.1.3.1. Testing CD=1 Queries 555 Ask for the SOA record of the zone the server is nominally configured 556 to serve. This query is made with only the CD DNS flag bit set and 557 all other DNS bits clear and without EDNS. 559 We expect the SOA record for the zone to be returned in the answer 560 section with the rcode set to NOERROR and the AA and QR bits to be 561 set in the response. We do not expect a OPT record to be returned. 563 If the server supports DNSSEC, CD should be set in the response 564 [RFC4035] otherwise CD should be clear [RFC1034]. 566 Check that queries with CD=1 work: 568 dig +noedns +noad +norec +cd soa $zone @$server 570 expect: status: NOERROR 571 expect: the SOA record to be present in the answer section 572 expect: flag: aa to be present 573 expect: flag: rd to NOT be present 574 expect: flag: ad to NOT be present 575 expect: the OPT record to NOT be present 577 CD use in queries is defined in [RFC4035]. 579 8.1.3.2. Testing AD=1 Queries 581 Ask for the SOA record of the zone the server is nominally configured 582 to serve. This query is made with only the AD DNS flag bit set and 583 all other DNS bits clear and without EDNS. 585 We expect the SOA record for the zone to be returned in the answer 586 section with the rcode set to NOERROR and the AA and QR bits to be 587 set in the response. We do not expect a OPT record to be returned. 589 If the server supports DNSSEC, AD may be set in the response 590 [RFC6840] otherwise AD should be clear [RFC1034]. 592 Check that queries with AD=1 work: 594 dig +noedns +norec +ad soa $zone @$server 596 expect: status: NOERROR 597 expect: the SOA record to be present in the answer section 598 expect: flag: aa to be present 599 expect: flag: rd to NOT be present 600 expect: the OPT record to NOT be present 602 AD use in queries is defined in [RFC6840]. 604 8.1.3.3. Testing Reserved Bit 606 Ask for the SOA record of the zone the server is nominally configured 607 to serve. This query is made with only the final reserved DNS flag 608 bit set and all other DNS bits clear and without EDNS. 610 We expect the SOA record for the zone to be returned in the answer 611 section with the rcode set to NOERROR and the AA and QR bits to be 612 set in the response, RA may be set. The final reserved bit must not 613 be set [RFC1034]. We do not expect a OPT record to be returned 614 [RFC6891]. 616 Check that queries with the last unassigned DNS header flag work and 617 that the flag bit is not copied to the response: 619 dig +noedns +noad +norec +zflag soa $zone @$server 621 expect: status: NOERROR 622 expect: the SOA record to be present in the answer section 623 expect: MBZ to NOT be in the response 624 expect: flag: aa to 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 MBZ (Must Be Zero) presence indicates the flag bit has been 630 incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved for 631 future use. Must be zero in all queries and responses." 633 8.1.4. Testing Unknown Opcodes 635 Construct a DNS message that consists of only a DNS header with 636 opcode set to 15 (currently not allocated), no DNS header bits set 637 and empty question, answer, authority and additional sections. 639 Check that new opcodes are handled: 641 dig +noedns +noad +opcode=15 +norec +header-only @$server 643 expect: status: NOTIMP 644 expect: SOA record to NOT be present 645 expect: flag: aa to NOT be present 646 expect: flag: rd to NOT be present 647 expect: flag: ad to NOT be present 648 expect: the OPT record to NOT be present 650 As unknown opcodes have no definition, including packet format other 651 than there must be a DNS header present (QR, OPCODE and RCODE are the 652 only header fields that need to be common across all opcodes, 653 everything else in the header can potentially be redefined), there is 654 only one possible rcode that make sense to return to a request with a 655 unknown opcode and that is NOTIMP. 657 8.1.5. Testing Recursive Queries 659 Ask for the SOA record of the zone the server is nominally configured 660 to serve. This query is made with only the RD DNS flag bit set and 661 without EDNS. 663 We expect the SOA record for the zone to be returned in the answer 664 section with the rcode set to NOERROR and the AA, QR and RD bits to 665 be set in the response, RA may also be set [RFC1034]. We do not 666 expect a OPT record to be returned [RFC6891]. 668 Check that recursive queries work: 670 dig +noedns +noad +rec soa $zone @$server 672 expect: status: NOERROR 673 expect: the SOA record to be present in the answer section 674 expect: flag: aa to be present 675 expect: flag: rd to be present 676 expect: flag: ad to NOT be present 677 expect: the OPT record to NOT be present 679 8.1.6. Testing TCP 681 Ask for the SOA record of the zone the server is nominally configured 682 to serve. This query is made with no DNS flag bits set and without 683 EDNS. This query is to be sent using TCP. 685 We expect the SOA record for the zone to be returned in the answer 686 section with the rcode set to NOERROR and the AA and QR bits to be 687 set in the response, RA may also be set [RFC1034]. We do not expect 688 a OPT record to be returned [RFC6891]. 690 Check that TCP queries work: 692 dig +noedns +noad +norec +tcp soa $zone @$server 694 expect: status: NOERROR 695 expect: the SOA record to be present in the answer section 696 expect: flag: aa to be present 697 expect: flag: rd to NOT be present 698 expect: flag: ad to NOT be present 699 expect: the OPT record to NOT be present 701 The requirement that TCP be supported is defined in [RFC7766]. 703 8.2. Testing - Extended DNS 705 The next set of test cover various aspects of EDNS behaviour. If any 706 of these tests succeed, then all of them should succeed. There are 707 servers that support EDNS but fail to handle plain EDNS queries 708 correctly so a plain EDNS query is not a good indicator of lack of 709 EDNS support. 711 8.2.1. Testing Minimal EDNS 713 Ask for the SOA record of the zone the server is nominally configured 714 to serve. This query is made with no DNS flag bits set. EDNS 715 version 0 is used without any EDNS options or EDNS flags set. 717 We expect the SOA record for the zone to be returned in the answer 718 section with the rcode set to NOERROR and the AA and QR bits to be 719 set in the response, RA may also be set [RFC1034]. We expect a OPT 720 record to be returned. There should be no EDNS flags present in the 721 response. The EDNS version field should be zero and there should be 722 no EDNS options present [RFC6891]. 724 Check that plain EDNS queries work: 726 dig +nocookie +edns=0 +noad +norec soa $zone @$server 728 expect: status: NOERROR 729 expect: the SOA record to be present in the answer section 730 expect: a OPT record to be present in the additional section 731 expect: EDNS Version 0 in response 732 expect: flag: aa to be present 733 expect: flag: ad to NOT be present 735 +nocookie disables sending a EDNS COOKIE option in which is on by 736 default in BIND 9.11.0. 738 8.2.2. Testing EDNS Version Negotiation 740 Ask for the SOA record of the zone the server is nominally configured 741 to serve. This query is made with no DNS flag bits set. EDNS 742 version 1 is used without any EDNS options or EDNS flags set. 744 We expect the SOA record for the zone to NOT be returned in the 745 answer section with the extended rcode set to BADVERS and the QR bit 746 to be set in the response, RA may also be set [RFC1034]. We expect a 747 OPT record to be returned. There should be no EDNS flags present in 748 the response. The EDNS version field should be zero as EDNS versions 749 other than 0 are yet to be specified and there should be no EDNS 750 options present [RFC6891]. 752 Check that EDNS version 1 queries work (EDNS supported): 754 dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server 756 expect: status: BADVERS 757 expect: the SOA record to NOT be present in the answer section 758 expect: a OPT record to be present in the additional section 759 expect: EDNS Version 0 in response 760 expect: flag: aa to NOT be present 761 expect: flag: ad to NOT be present 763 Only EDNS Version 0 is currently defined so the response should 764 always be a 0 version. This will change when EDNS version 1 is 765 defined. BADVERS is the expected rcode if EDNS is supported as per 766 Section 6.1.3, [RFC6891]. 768 8.2.3. Testing Unknown EDNS Options 770 Ask for the SOA record of the zone the server is nominally configured 771 to serve. This query is made with no DNS flag bits set. EDNS 772 version 0 is used without any EDNS flags. A EDNS option is present 773 with a value from the yet to be assigned range. The unassigned value 774 chosen is 100 and will need to be adjusted when IANA assigns this 775 value formally. 777 We expect the SOA record for the zone to be returned in the answer 778 section with the rcode set to NOERROR and the AA and QR bits to be 779 set in the response, RA may also be set [RFC1034]. We expect a OPT 780 record to be returned. There should be no EDNS flags present in the 781 response. The EDNS version field should be zero as EDNS versions 782 other than 0 are yet to be specified and there should be no EDNS 783 options present as unknown EDNS options are supposed to be ignored by 784 the server [RFC6891]. 786 Check that EDNS queries with an unknown option work (EDNS supported): 788 dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 790 expect: status: NOERROR 791 expect: the SOA record to be present in the answer section 792 expect: a OPT record to be present in the additional section 793 expect: OPT=100 to NOT be present 794 expect: EDNS Version 0 in response 795 expect: flag: aa to be present 796 expect: flag: ad to NOT be present 798 Unknown EDNS options are supposed to be ignored, Section 6.1.2, 799 [RFC6891]. 801 8.2.4. Testing Unknown EDNS Flags 803 Ask for the SOA record of the zone the server is nominally configured 804 to serve. This query is made with no DNS flag bits set. EDNS 805 version 0 is used without any EDNS options. A unassigned EDNS flag 806 bit is set (0x40 in this case). 808 We expect the SOA record for the zone to be returned in the answer 809 section with the rcode set to NOERROR and the AA and QR bits to be 810 set in the response, RA may also be set [RFC1034]. We expect a OPT 811 record to be returned. There should be no EDNS flags present in the 812 response as unknown EDNS flags are supposed to be ignored. The EDNS 813 version field should be zero and there should be no EDNS options 814 present [RFC6891]. 816 Check that EDNS queries with unknown flags work (EDNS supported): 818 dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 820 expect: status: NOERROR 821 expect: the SOA record to be present in the answer section 822 expect: a OPT record to be present in the additional section 823 expect: MBZ not to be present 824 expect: EDNS Version 0 in response 825 expect: flag: aa to be present 826 expect: flag: ad to NOT be present 828 MBZ (Must Be Zero) presence indicates the flag bit has been 829 incorrectly copied as per Section 6.1.4, [RFC6891]. 831 8.2.5. Testing EDNS Version Negotiation With Unknown EDNS Flags 833 Ask for the SOA record of the zone the server is nominally configured 834 to serve. This query is made with no DNS flag bits set. EDNS 835 version 1 is used without any EDNS options. A unassigned EDNS flag 836 bit is set (0x40 in this case). 838 We expect the SOA record for the zone to NOT be returned in the 839 answer section with the extended rcode set to BADVERS and the QR bit 840 to be set in the response, RA may also be set [RFC1034]. We expect a 841 OPT record to be returned. There should be no EDNS flags present in 842 the response as unknown EDNS flags are supposed to be ignored. The 843 EDNS version field should be zero as EDNS versions other than 0 are 844 yet to be specified and there should be no EDNS options present 845 [RFC6891]. 847 Check that EDNS version 1 queries with unknown flags work (EDNS 848 supported): 850 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 851 $zone @$server 853 expect: status: BADVERS 854 expect: SOA record to NOT be present 855 expect: a OPT record to be present in the additional section 856 expect: MBZ not to be present 857 expect: EDNS Version 0 in response 858 expect: flag: aa to NOT be present 859 expect: flag: ad to NOT be present 861 +noednsneg disables EDNS version negotiation in DiG; MBZ (Must Be 862 Zero) presence indicates the flag bit has been incorrectly copied. 864 8.2.6. Testing EDNS Version Negotiation With Unknown EDNS Options 866 Ask for the SOA record of the zone the server is nominally configured 867 to serve. This query is made with no DNS flag bits set. EDNS 868 version 1 is used. A unknown EDNS option is present (option code 100 869 has been chosen). 871 We expect the SOA record for the zone to NOT be returned in the 872 answer section with the extended rcode set to BADVERS and the QR bit 873 to be set in the response, RA may also be set [RFC1034]. We expect a 874 OPT record to be returned. There should be no EDNS flags present in 875 the response. The EDNS version field should be zero as EDNS versions 876 other than 0 are yet to be specified and there should be no EDNS 877 options present [RFC6891]. 879 Check that EDNS version 1 queries with unknown options work (EDNS 880 supported): 882 dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \ 883 $zone @$server 885 expect: status: BADVERS 886 expect: SOA record to NOT be present 887 expect: a OPT record to be present in the additional section 888 expect: OPT=100 to NOT be present 889 expect: EDNS Version 0 in response 890 expect: flag: aa to be present 891 expect: flag: ad to NOT be present 893 +noednsneg disables EDNS version negotiation in DiG. 895 8.2.7. Testing Truncated Responses 897 Ask for the DNSKEY records of the zone the server is nominally 898 configured to serve. This query is made with no DNS flag bits set. 899 EDNS version 0 is used without any EDNS options. The only EDNS flag 900 set is DO. The EDNS UDP buffer size is set to 512. The intention of 901 this query is elicit a truncated response from the server. Most 902 signed DNSKEY responses are bigger than 512 bytes. 904 We expect a response with the rcode set to NOERROR and the AA and QR 905 bits to be set, AD may be set in the response if the server supports 906 DNSSEC otherwise it should be clear. TC and RA may also be set 907 [RFC1034]. We expect a OPT record to be present in the response. 908 There should be no EDNS flags other than DO present in the response. 909 The EDNS version field should be zero and there should be no EDNS 910 options present [RFC6891]. 912 If TC is not set it is not possible to confirm that the server 913 correctly adds the OPT record to the truncated responses or not. 915 dig +norec +dnssec +bufsize=512 +ignore dnskey $zone @$server 916 expect: NOERROR 917 expect: OPT record with version set to 0 919 8.2.8. Testing DNSSEC Queries 921 Ask for the SOA record of the zone the server is nominally configured 922 to serve. This query is made with no DNS flag bits set. EDNS 923 version 0 is used without any EDNS options. The only EDNS flag set 924 is DO. 926 We expect the SOA record for the zone to be returned in the answer 927 section with the rcode set to NOERROR and the AA and QR bits to be 928 set in the response, AD may be set in the response if the server 929 supports DNSSEC otherwise it should be clear. RA may also be set 930 [RFC1034]. We expect a OPT record to be returned. There should be 931 no EDNS flags other than DO present in the response which should be 932 present if the server supports DNSSEC. The EDNS version field should 933 be zero and there should be no EDNS options present [RFC6891]. 935 Check that a DNSSEC queries work (EDNS supported): 937 dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server 939 expect: status: NOERROR 940 expect: the SOA record to be present in the answer section 941 expect: a OPT record to be present in the additional section 942 expect: DO=1 to be present if a RRSIG is in the response 943 expect: EDNS Version 0 in response 944 expect: flag: aa to be present 946 DO=1 should be present if RRSIGs are returned as they indicate that 947 the server supports DNSSEC. Servers that support DNSSEC are supposed 948 to copy the DO bit from the request to the response as per [RFC3225]. 950 8.2.9. Testing EDNS Version Negotiation With DNSSEC 952 Ask for the SOA record of the zone the server is nominally configured 953 to serve. This query is made with no DNS flag bits set. EDNS 954 version 1 is used without any EDNS options. The only EDNS flag set 955 is DO. 957 We expect the SOA record for the zone to NOT be returned in the 958 answer section with the rcode set to BADVERS and the only the QR bit 959 and possibly the RA bit to be set [RFC1034]. We expect a OPT record 960 to be returned. There should be no EDNS flags other than DO present 961 in the response which should be present if the server supports 962 DNSSEC. The EDNS version field should be zero and there should be no 963 EDNS options present [RFC6891]. 965 Check that EDNS version 1 DNSSEC queries work (EDNS supported): 967 dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \ 968 $zone @$server 970 expect: status: BADVERS 971 expect: SOA record to NOT be present 972 expect: a OPT record to be present in the additional section 973 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 974 returned DO=1 975 expect: EDNS Version 0 in response 976 expect: flag: aa to NOT be present 978 +noednsneg disables EDNS version negotiation in DiG. 980 8.2.10. Testing With Multiple Defined EDNS Options 982 Ask for the SOA record of the zone the server is nominally configured 983 to serve. This query is made with no DNS flag bits set. EDNS 984 version 0 is used. A number of defined EDNS options are present 985 (NSID [RFC5001], DNS COOKIE [RFC7873], EDNS Client Subnet [RFC7871] 986 and EDNS Expire [RFC7314]). 988 We expect the SOA record for the zone to be returned in the answer 989 section with the rcode set to NOERROR and the AA and QR bits to be 990 set in the response, RA may also be set [RFC1034]. We expect a OPT 991 record to be returned. There should be no EDNS flags present in the 992 response. The EDNS version field should be zero. Any of the 993 requested EDNS options supported by the server and permitted server 994 configuration may be returned [RFC6891]. 996 Check that EDNS queries with multiple defined EDNS options work: 998 dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \ 999 soa $zone @$server 1001 expect: status: NOERROR 1002 expect: the SOA record to be present in the answer section 1003 expect: a OPT record to be present in the additional section 1004 expect: EDNS Version 0 in response 1005 expect: flag: aa to be present 1006 expect: flag: ad to NOT be present 1008 8.3. When EDNS Is Not Supported 1010 If EDNS is not supported by the nameserver, we expect a response to 1011 all the above queries. That response may be a FORMERR or NOTIMP 1012 error response or the OPT record may just be ignored. 1014 Some nameservers only return a EDNS response when a particular EDNS 1015 option or flag (e.g. DO=1) is present in the request. This 1016 behaviour is not compliant behaviour and may hide other incorrect 1017 behaviour from the above tests. Re-testing with the triggering 1018 option / flag present will expose this misbehaviour. 1020 9. Remediation 1022 Name server operators are generally expected to test their own 1023 infrastructure for compliance to standards. The above tests should 1024 be run when new systems are brought online, and should be repeated 1025 periodically to ensure continued interoperability. 1027 Domain registrants who do not maintain their own DNS infrastructure 1028 are entitled to a DNS service that conforms to standards and 1029 interoperates well. Registrants who become aware that their DNS 1030 operator does not have a well maintained or compliant infrastructure 1031 should insist that their service provider correct issues, and switch 1032 providers if they do not. 1034 In the event that an operator experiences problems due to the 1035 behaviour of name servers outside their control, the above tests will 1036 help in narrowing down the precise issue(s) which can then be 1037 reported to the relevant party. 1039 If contact information for the operator of a misbehaving name server 1040 is not already known, the following methods of communication could be 1041 considered: 1043 o the RNAME of the zone authoritative for the name of the 1044 misbehaving server 1046 o the RNAME of zones for which the offending server is authoritative 1048 o administrative or technical contacts listed in the registration 1049 information for the parent domain of the name of the misbehaving 1050 server, or for zones for which the name server is authoritative 1052 o the registrar or registry for such zones 1054 o DNS-specific operational fora (e.g. mailing lists) 1056 Operators of parent zones may wish to regularly test the 1057 authoritative name servers of their child zones. However, parent 1058 operators can have widely varying capabilities in terms of 1059 notification or remediation depending on whether they have a direct 1060 relationship with the child operator. Many TLD registries, for 1061 example, cannot directly contact their registrants and may instead 1062 need to communicate through the relevant registrar. In such cases 1063 it may be most efficient for registrars to take on the responsibility 1064 for testing the name servers of their registrants, since they have a 1065 direct relationship. 1067 When notification is not effective at correcting problems with a 1068 misbehaving name server, parent operators can choose to remove NS 1069 record sets (and glue records below) that refer to the faulty server. 1070 This should only be done as a last resort and with due consideration, 1071 as removal of a delegation can have unanticipated side effects. For 1072 example, other parts of the DNS tree may depend on names below the 1073 removed zone cut, and the parent operator may find themselves 1074 responsible for causing new DNS failures to occur. 1076 10. Security Considerations 1078 Testing protocol compliance can potentially result in false reports 1079 of attempts to break services from Intrusion Detection Services and 1080 firewalls. None of the tests listed above should break nominally 1081 EDNS compliant servers. None of the tests above should break non 1082 EDNS servers. All the tests above are well formed, though not 1083 necessarily common, DNS queries. 1085 Relaxing firewall settings to ensure EDNS compliance could 1086 potentially expose a critical implementation flaw in the nameserver. 1087 Nameservers should be tested for conformance before relaxing firewall 1088 settings. 1090 When removing delegations for non-compliant servers there can be a 1091 knock on effect on other zones that require these zones to be 1092 operational for the nameservers addresses to be resolved. 1094 11. IANA Considerations 1096 There are no actions for IANA. 1098 12. References 1100 12.1. Normative References 1102 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1103 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1104 . 1106 [RFC1035] Mockapetris, P., "Domain names - implementation and 1107 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1108 November 1987, . 1110 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 1111 RFC 3225, DOI 10.17487/RFC3225, December 2001, 1112 . 1114 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1115 Rose, "Protocol Modifications for the DNS Security 1116 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1117 . 1119 [RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and 1120 Implementation Notes for DNS Security (DNSSEC)", RFC 6840, 1121 DOI 10.17487/RFC6840, February 2013, 1122 . 1124 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1125 for DNS (EDNS(0))", STD 75, RFC 6891, 1126 DOI 10.17487/RFC6891, April 2013, 1127 . 1129 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1130 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1131 April 2013, . 1133 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1134 D. Wessels, "DNS Transport over TCP - Implementation 1135 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1136 . 1138 12.2. Informative References 1140 [RFC5001] Austein, R., "DNS Name Server Identifier (NSID) Option", 1141 RFC 5001, DOI 10.17487/RFC5001, August 2007, 1142 . 1144 [RFC7314] Andrews, M., "Extension Mechanisms for DNS (EDNS) EXPIRE 1145 Option", RFC 7314, DOI 10.17487/RFC7314, July 2014, 1146 . 1148 [RFC7871] Contavalli, C., van der Gaast, W., Lawrence, D., and W. 1149 Kumari, "Client Subnet in DNS Queries", RFC 7871, 1150 DOI 10.17487/RFC7871, May 2016, 1151 . 1153 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 1154 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 1155 . 1157 Author's Address 1159 M. Andrews 1160 Internet Systems Consortium 1161 950 Charter Street 1162 Redwood City, CA 94063 1163 US 1165 Email: marka@isc.org