idnits 2.17.1 draft-andrews-dns-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 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 1, 2014) is 3433 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 5966 (Obsoleted by RFC 7766) Summary: 3 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 Expires: June 4, 2015 December 1, 2014 6 A Common Operational Problem in DNS Servers - Failure To Respond. 7 draft-andrews-dns-no-response-issue-06.txt 9 Abstract 11 The DNS is a query / response protocol. Failure to respond to 12 queries causes both immediate operational problems and long term 13 problems with protocol development. 15 This document identifies a number of common classes of queries that 16 some servers fail to respond too. This document also suggests 17 procedures for TLD and other similar zone operators to apply to 18 reduce / eliminate the problem. 20 Status of this Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on June 4, 2015. 37 Copyright Notice 39 Copyright (c) 2014 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. Common queries class that result in non responses. . . . . . . 4 56 2.1. EDNS Queries - Version Independent . . . . . . . . . . . . 4 57 2.2. EDNS Queries - Version Specific . . . . . . . . . . . . . 4 58 2.3. EDNS Options . . . . . . . . . . . . . . . . . . . . . . . 4 59 2.4. EDNS Flags . . . . . . . . . . . . . . . . . . . . . . . . 5 60 2.5. Unknown / Unsupported Type Queries . . . . . . . . . . . . 5 61 2.6. TCP Queries . . . . . . . . . . . . . . . . . . . . . . . 5 62 3. Remediating . . . . . . . . . . . . . . . . . . . . . . . . . 5 63 4. Firewalls and Load Balancers . . . . . . . . . . . . . . . . . 7 64 5. Response Code Selection . . . . . . . . . . . . . . . . . . . 7 65 6. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 66 7. Normative References . . . . . . . . . . . . . . . . . . . . . 11 67 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 11 69 1. Introduction 71 The DNS [RFC1034], [RFC1035] is a query / response protocol. Failure 72 to respond to queries causes both immediate operational problems and 73 long term problems with protocol development. 75 Failure to respond to a query is indistinguishable from a packet loss 76 without doing a analysis of query response patterns and results in 77 unnecessary additional queries being made by DNS clients and 78 unnecessary delays being introduced to the resolution process. 80 Due to the inability to distingish between packet loss and 81 nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes 82 misclassified as lack of EDNS support which can lead to DNSSEC 83 validation failures. 85 Allowing servers which fail to respond to queries to remain results 86 in developers being afraid to deploy implementations of recent 87 standards. Such servers need to be identified and corrected / 88 replaced. 90 The DNS has response codes that cover almost any conceivable query 91 response. A nameserver should be able to respond to any conceivable 92 query using them. 94 Unless a nameserver is under attack, it should respond to all queries 95 directed to it as a result of following delegations. Additionally 96 code should not assume that there isn't a delegation to the server 97 even if it is not configured to serve the zone. Broken delegation 98 are a common occurrence in the DNS and receiving queries for zones 99 that you are not configured for is not a necessarily a indication 100 that you are under attack. Parent zone operators are supposed to 101 regularly check that the delegating NS records are consistent with 102 those of the delegated zone and to correct them when they are not 103 [RFC1034]. If this was being done regularly the instances of broken 104 delegations would be much lower. 106 When a nameserver is under attack it may wish to drop packets. A 107 common attack is to use a nameserver as a amplifier by sending 108 spoofed packets. This is done because response packets are bigger 109 than the queries and big amplification factors are available 110 especially if EDNS is supported. Limiting the rate of responses is 111 reasonable when this is occurring and the client should retry. This 112 however only works if legitimate clients are not being forced to 113 guess whether EDNS queries are accept or not. While there is still a 114 pool of servers that don't respond to EDNS requests, clients have no 115 way to know if the lack of response is due to packet loss, EDNS 116 packets not being supported or rate limiting due to the server being 117 under attack. Mis-classifications of server characteristics are 118 unavoidable when rate limiting is done. 120 2. Common queries class that result in non responses. 122 There are three common query classes that result in non responses 123 today. These are EDNS queries, queries for unknown (unallocated) or 124 unsupported types and filtering of TCP queries. 126 2.1. EDNS Queries - Version Independent 128 Identifying servers that fail to respond to EDNS queries can be done 129 by first identifying that the server responds to regular DNS queries 130 then making a series of otherwise identical responses using EDNS, 131 then making the original query again. A series of EDNS queries is 132 needed as at least one DNS implementation responds to the first EDNS 133 query with FORMERR but fails to respond to subsequent queries from 134 the same address for a period until a regular DNS query is made. The 135 EDNS query should specify a UDP buffer size of 512 bytes to avoid 136 false classification of not supporting EDNS due to response packet 137 size. 139 If the server responds to the first and last queries but fails to 140 respond to most or all of the EDNS queries it is probably faulty. 141 The test should be repeated a number of times to eliminate the 142 likelihood of a false positive due to packet loss. 144 Firewalls may also block larger EDNS responses but there is no easy 145 way to check authoritative servers to see if the firewall is 146 misconfigured. 148 2.2. EDNS Queries - Version Specific 150 Some servers respond correctly to EDNS version 0 queries but fail to 151 respond to EDNS queries with version numbers that are higher than 152 zero. Servers should respond with BADVERS to EDNS queries with 153 version numbers that they do not support. 155 Some servers respond correctly to EDNS version 0 queries but fail to 156 set QR=1 when responding to EDNS versions they do not support. Such 157 answer are discarded or treated as requests. 159 2.3. EDNS Options 161 Some servers fail to respond to EDNS queries with EDNS options set. 162 Unknown EDNS options are supposed to be ignored by the server 163 [RFC6891]. 165 2.4. EDNS Flags 167 Some servers fail to respond to EDNS queries with EDNS Flags set. 168 Server should ignore EDNS flags there do not understand and not add 169 them to the response [RFC6891]. 171 2.5. Unknown / Unsupported Type Queries 173 Identifying servers that fail to respond to unknown or unsupported 174 types can be done by making an initial DNS query for an A record, 175 making a number of queries for an unallocated type, them making a 176 query for an A record again. IANA maintains a registry of allocated 177 types. 179 If the server responds to the first and last queries but fails to 180 respond to the queries for the unallocated type it is probably 181 faulty. The test should be repeated a number of times to eliminate 182 the likely hood of a false positive due to packet loss. 184 2.6. TCP Queries 186 All DNS servers are supposed to respond to queries over TCP 187 [RFC5966]. Firewalls that drop TCP connection attempts rather that 188 resetting the connect attempt or send a ICMP/ICMPv6 administratively 189 prohibited message introduce excessive delays to the resolution 190 process. 192 Whether a server accepts TCP connections can be tested by first 193 checking that it responds to UDP queries to confirm that it is up and 194 operating then attempting the same query over TCP. An additional 195 query should be made over UDP if the TCP connection attempt fails to 196 confirm that the server under test is still operating. 198 3. Remediating 200 While the first step in remediating this problem is to get the 201 offending nameserver code corrected, there is a very long tail 202 problem with DNS servers in that it can often take over a decade 203 between the code being corrected and a nameserver being upgraded with 204 corrected code. With that in mind it is requested that TLD, and 205 other similar zone operators, take steps to identify and inform their 206 customers, directly or indirectly through registrars, that they are 207 running such servers and that the customers need to correct the 208 problem. 210 TLD operators should construct a list of servers child zones are 211 delegated to along with a delegated zone name. This name shall be 212 the query name used to test the server as it is supposed to exist. 214 For each server the TLD operator shall make an SOA query the 215 delegated zone name. This should result in the SOA record being 216 returned in the answer section. If the SOA record is not return but 217 some other response is returned this is a indication of a bad 218 delegation and the TLD operator should take whatever steps it 219 normally takes to rectify a bad delegation. If more that one zone is 220 delegated to the server it should choose another zone until it finds 221 a zone which responds correctly or it exhausts the list of zones 222 delegated to the server. 224 If the server fails to get a response to a SOA query the TLD operator 225 should make a A query as some nameservers fail to respond to SOA 226 queries but respond to A queries. If it gets no response to the A 227 query another delegated zone should be queried for as some 228 nameservers fail to respond to zones they are not configured for. If 229 subsequent queries find a responding zone all delegation to this 230 server need to be checked and rectified using the TLD's normal 231 procedures. 233 Having identified a working tuple the TLD 234 operator should now check that the server responds to EDNS, Unknown 235 Query Type and TCP tests as described above. If the TLD operator 236 finds that server fails any of the tests, the TLD operator shall take 237 steps to inform the operator of the server that they are running a 238 faulty nameserver and that they need to take steps to correct the 239 matter. The TLD operator shall also record the 240 for followup testing. 242 If repeated attempts to inform and get the customer to correct / 243 replace the faulty server are unsuccessful the TLD operator shall 244 remove all delegations to said server from the zone. 246 It will also be necessary for TLD operators to repeat the scans 247 periodically. It is recommended that this be performed monthly 248 backing off to bi-annually once the numbers of faulty servers found 249 drops off to less than 1 in 100000 servers tested. Follow up tests 250 for faulty servers still need to be performed monthly. 252 Some operators claim that they can't perform checks at registration 253 time. If a check is not performed at registration time it needs to 254 be performed within a week of registration in order to detect faulty 255 servers swiftly. 257 Checking of delegations by TLD operators should be nothing new as 258 they have been required from the very beginnings of DNS to do this 259 [RFC1034]. Checking for compliance of nameserver operations should 260 just be a extension of such testing. 262 It is recommended that TLD operators setup a test web page which 263 performs the tests the TLD operator performs as part of their regular 264 audits to allow nameserver operators to test that they have correctly 265 fixed their servers. Such tests should be rate limited to avoid 266 these pages being a denial of service vector. 268 4. Firewalls and Load Balancers 270 Firewalls and load balancers can affect the externally visible 271 behaviour of a nameserver. Tests for conformance need to be done 272 from outside of any firewall so that the system as a whole is tested. 274 Firewalls and load balancers should not drop DNS packets that they 275 don't understand. They should either pass through the packets or 276 generate a appropriate error response. 278 Requests for unknown query types are not attacks and should not be 279 treated as such. 281 Requests with unassigned flags set (DNS or EDNS) are not attacks and 282 should not be treated as such. The behaviour for unassigned is to 283 ignore them in the request and to not set them in the response. All 284 dropping DNS / EDNS packets with unassigned flags does is make it 285 harder to deploy extension that make use of them due to the need to 286 reconfigure / update firewalls. 288 Requests with unknown EDNS options are not a attack and should not be 289 treated as such. The correct behaviour for unknown EDNS options is 290 to ignore them. 292 Requests with unknown EDNS versions are not a attack and should not 293 be treated as such. The correct behaviour for unknown EDNS versions 294 is to return BADVERS along with the highest EDNS version the server 295 supports. All dropping EDNS packets does is break EDNS version 296 negotiation. 298 5. Response Code Selection 300 Choosing the correct response code when fixing a nameserver is 301 important. Just because a type is not implemented does not mean that 302 NOTIMP is the correct response code to return. Response codes need 303 to be chosen considering how clients will handle them. 305 For unimplemented opcodes NOTIMP is the expected response code. 307 In general, for unimplemented type codes Name Error (NXDOMAIN) and 308 NOERROR (no data) are the expected response codes. A server is not 309 supposed to serve a zone which contains unsupported types ([RFC1034]) 310 so the only thing left is return if the QNAME exists or not. NOTIMP 311 and REFUSED are not useful responses as they force the clients to try 312 all the authoritative servers for a zone looking for a server which 313 will answer the query. 315 Meta queries type may be the exception but these need to be thought 316 about on a case by case basis. 318 If you support EDNS and get a query with a unsupported EDNS version 319 the correct response is BADVERS [RFC6891]. 321 If you do not support EDNS at all FORMERR and NOTIMP are the expected 322 error codes. That said a minimal EDNS server implementation just 323 requires parsing the OPT records and responding with a empty OPT 324 record. There is no need to interpret any EDNS options present in 325 the request as unsupported options are expected to be ignored 326 [RFC6891]. 328 6. Testing 330 Verify the server is configured for the zone: 332 dig +noedns +noad +norec soa $zone @$server 334 expect: status: NOERROR 335 expect: SOA record 337 Check that TCP queries work: 339 dig +noedns +noad +norec +tcp soa $zone @$server 341 expect: status: NOERROR 342 expect: SOA record 344 Check that queries for a unknown type to work: 346 dig +noedns +noad +norec type1000 $zone @$server 348 expect: status: NOERROR 349 expect: a empty answer section. 351 Check that queries the CD=1 work: 353 dig +noedns +noad +norec +cd soa $zone @$server 355 expect: status: NOERROR 356 expect: SOA record to be present 358 Check that queries the AD=1 work: 360 dig +noedns +norec +ad soa $zone @$server 362 expect: status: NOERROR 363 expect: SOA record to be present 365 Check that queries with the last unassigned DNS header flag to work: 367 dig +noedns +noad +norec +zflag soa $zone @$server 369 expect: status: NOERROR 370 expect: SOA record to be present 371 expect: MBZ to not be in the response 373 Check that plain EDNS queries work: 375 dig +edns=0 +noad +norec soa $zone @$server 377 expect: status: NOERROR 378 expect: SOA record to be present 379 expect: OPT record to be present 380 expect: EDNS Version 0 in response 382 Check that EDNS version 1 queries work (EDNS supported): 384 dig +edns=1 +noednsneg +noad +norec soa $zone @$server 386 expect: status: BADVERS 387 expect: SOA record to not be present 388 expect: OPT record to be present 389 expect: EDNS Version 0 in response 390 (this will change when EDNS version 1 is defined) 392 Check that EDNS queries with a unknown option work (EDNS supported): 394 dig +edns=0 +noad +norec +ednsopt=100 soa $zone @$server 396 expect: status: NOERROR 397 expect: SOA record to be present 398 expect: OPT record to be present 399 expect: OPT=100 to not be present 400 expect: EDNS Version 0 in response 401 Check that EDNS queries with a unknown flags work (EDNS supported): 403 dig +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server 405 expect: status: NOERROR 406 expect: SOA record to be present 407 expect: OPT record to be present 408 expect: MBZ not to be present 409 expect: EDNS Version 0 in response 411 Check that EDNS version 1 queries with a unknown flags work (EDNS 412 supported): 414 dig +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \ 415 $zone @$server 417 expect: status: BADVERS 418 expect: SOA record to NOT be present 419 expect: OPT record to be present 420 expect: MBZ not to be present 421 expect: EDNS Version 0 in response 423 Check that EDNS version 1 queries with a unknown options work (EDNS 424 supported): 426 dig +edns=1 +noednsneg +noad +norec +ednsopt=100 soa $zone @$server 428 expect: status: BADVERS 429 expect: SOA record to NOT be present 430 expect: OPT record to be present 431 expect: OPT=100 to NOT be present 432 expect: EDNS Version 0 in response 434 Check that a DNSSEC queries work (EDNS supported): 436 dig +edns=0 +noad +norec +dnssec soa $zone @$server 438 expect: status: NOERROR 439 expect: SOA record to be present 440 expect: OPT record to be present 441 expect: DO=1 to be present if a RRSIG is in the response 442 expect: EDNS Version 0 in response 444 DO=1 as per [RFC3225]. 446 Check that EDNS version 1 DNSSEC queries work (EDNS supported): 448 dig +edns=1 +noednsneg +noad +norec +dnssec soa \ 449 $zone @$server 451 expect: status: BADVERS 452 expect: SOA record to not be present 453 expect: OPT record to be present 454 expect: DO=1 to be present if the EDNS version 0 DNSSEC query test 455 returned DO=1 456 expect: EDNS Version 0 in response 458 If EDNS is not supported by the nameserver we expect a response to 459 all the above queries. That response may be a FORMERR or NOTIMP 460 error response or the OPT record may just be ignored. 462 It is advisable to run all the above tests in parallel so as to 463 minimise the delays due to multiple timeouts when the servers do not 464 respond. 466 The above tests use dig from BIND 9.11.0 which is still in 467 development. 469 7. Normative References 471 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 472 STD 13, RFC 1034, November 1987. 474 [RFC1035] Mockapetris, P., "Domain names - implementation and 475 specification", STD 13, RFC 1035, November 1987. 477 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 478 RFC 3225, December 2001. 480 [RFC5966] Bellis, R., "DNS Transport over TCP - Implementation 481 Requirements", RFC 5966, August 2010. 483 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 484 for DNS (EDNS(0))", STD 75, RFC 6891, April 2013. 486 Author's Address 488 M. Andrews 489 Internet Systems Consortium 490 950 Charter Street 491 Redwood City, CA 94063 492 US 494 Email: marka@isc.org