idnits 2.17.1 draft-ietf-dnsop-dns-tcp-requirements-02.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 : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The draft header indicates that this document updates RFC1123, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC1123, updated by this document, for RFC5378 checks: 1989-10-01) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 16, 2018) is 2171 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) == Missing Reference: 'RFC768' is mentioned on line 831, but not defined == Missing Reference: 'RFC793' is mentioned on line 831, but not defined ** Obsolete undefined reference: RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 2460 (Obsoleted by RFC 8200) -- Obsolete informational reference (is this intentional?): RFC 2541 (Obsoleted by RFC 4641) -- Obsolete informational reference (is this intentional?): RFC 2671 (Obsoleted by RFC 6891) -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 6304 (Obsoleted by RFC 7534) Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Domain Name System Operations J. Kristoff 3 Internet-Draft DePaul University 4 Updates: 1123 (if approved) D. Wessels 5 Intended status: Best Current Practice Verisign 6 Expires: November 17, 2018 May 16, 2018 8 DNS Transport over TCP - Operational Requirements 9 draft-ietf-dnsop-dns-tcp-requirements-02 11 Abstract 13 This document encourages the practice of permitting DNS messages to 14 be carried over TCP on the Internet. It also considers the 15 consequences with this form of DNS communication and the potential 16 operational issues that can arise when this best common practice is 17 not upheld. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on November 17, 2018. 36 Copyright Notice 38 Copyright (c) 2018 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 55 2. Background . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2.1. Uneven Transport Usage and Preference . . . . . . . . . . 3 57 2.2. Waiting for Large Messages and Reliability . . . . . . . 4 58 2.3. EDNS0 . . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 2.4. Fragmentation and Truncation . . . . . . . . . . . . . . 5 60 2.5. "Only Zone Transfers Use TCP" . . . . . . . . . . . . . . 6 61 3. DNS over TCP Requirements . . . . . . . . . . . . . . . . . . 6 62 4. Network and System Considerations . . . . . . . . . . . . . . 8 63 4.1. Connection Admission . . . . . . . . . . . . . . . . . . 8 64 4.2. Connection Management . . . . . . . . . . . . . . . . . . 9 65 4.3. Connection Termination . . . . . . . . . . . . . . . . . 9 66 5. DNS over TCP Filtering Risks . . . . . . . . . . . . . . . . 10 67 5.1. DNS Wedgie . . . . . . . . . . . . . . . . . . . . . . . 10 68 5.2. DNS Root Zone KSK Rollover . . . . . . . . . . . . . . . 11 69 5.3. DNS-over-TLS . . . . . . . . . . . . . . . . . . . . . . 11 70 6. Logging and Monitoring . . . . . . . . . . . . . . . . . . . 11 71 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 72 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 73 9. Security Considerations . . . . . . . . . . . . . . . . . . . 12 74 10. Privacy Considerations . . . . . . . . . . . . . . . . . . . 12 75 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 76 11.1. Normative References . . . . . . . . . . . . . . . . . . 13 77 11.2. Informative References . . . . . . . . . . . . . . . . . 13 78 Appendix A. Standards Related to DNS Transport over TCP . . . . 17 79 A.1. TODO - additional, relevant RFCs . . . . . . . . . . . . 17 80 A.2. IETF RFC 5936 - DNS Zone Transfer Protocol (AXFR) . . . . 17 81 A.3. IETF RFC 6304 - AS112 Nameserver Operations . . . . . . . 17 82 A.4. IETF RFC 6762 - Multicast DNS . . . . . . . . . . . . . . 17 83 A.5. IETF RFC 6950 - Architectural Considerations on 84 Application Features in the DNS . . . . . . . . . . . . . 18 85 A.6. IETF RFC 7477 - Child-to-Parent Synchronization in DNS . 18 86 A.7. IETF RFC 7720 - DNS Root Name Service Protocol and 87 Deployment Requirements . . . . . . . . . . . . . . . . . 18 88 A.8. IETF RFC 7766 - DNS Transport over TCP - Implementation 89 Requirements . . . . . . . . . . . . . . . . . . . . . . 18 90 A.9. IETF RFC 7828 - The edns-tcp-keepalive EDNS0 Option . . . 18 91 A.10. IETF RFC 7858 - Specification for DNS over Transport 92 Layer Security (TLS) . . . . . . . . . . . . . . . . . . 18 93 A.11. IETF RFC 7873 - Domain Name System (DNS) Cookies . . . . 19 94 A.12. IETF RFC 7901 - CHAIN Query Requests in DNS . . . . . . . 19 95 A.13. IETF RFC 8027 - DNSSEC Roadblock Avoidance . . . . . . . 19 96 A.14. IETF RFC 8094 - DNS over Datagram Transport Layer 97 Security (DTLS) . . . . . . . . . . . . . . . . . . . . . 19 98 A.15. IETF RFC 8162 - Using Secure DNS to Associate 99 Certificates with Domain Names for S/MIME . . . . . . . . 19 100 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 20 102 1. Introduction 104 DNS messages may be delivered using UDP or TCP communications. While 105 most DNS transactions are carried over UDP, some operators have been 106 led to believe that any DNS over TCP traffic is unwanted or 107 unnecessary for general DNS operation. As usage and features have 108 evolved, TCP transport has become increasingly important for correct 109 and safe operation of the Internet DNS. Reflecting modern usage, the 110 DNS standards were recently updated to declare support for TCP is now 111 a required part of the DNS implementation specifications in 112 [RFC7766]. This document is the formal requirements equivalent for 113 the operational community, encouraging operators to ensure DNS over 114 TCP communications support is on par with DNS over UDP 115 communications. 117 1.1. Requirements Language 119 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 120 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 121 document are to be interpreted as described in RFC 2119 [RFC2119]. 123 2. Background 125 The curious state of disagreement in operational best practices and 126 guidance for DNS transport protocols derives from conflicting 127 messages operators have gotten from other operators, implementors, 128 and even the IETF. Sometimes these mixed signals have been explicit, 129 on other occasions they have suspiciously implicit. Here we 130 summarize our interpretation of the storied and conflicting history 131 that has brought us to this document. 133 2.1. Uneven Transport Usage and Preference 135 In the original suite of DNS specifications, [RFC1034] and [RFC1035] 136 clearly specified that DNS messages could be carried in either UDP or 137 TCP, but they also made clear a preference for UDP as the transport 138 for queries in the general case. As stated in [RFC1035]: 140 "While virtual circuits can be used for any DNS activity, 141 datagrams are preferred for queries due to their lower overhead 142 and better performance." 144 Another early, important, and influential document, [RFC1123], 145 detailed the preference for UDP more explicitly: 147 "DNS resolvers and recursive servers MUST support UDP, and SHOULD 148 support TCP, for sending (non-zone-transfer) queries." 150 and further stipulated: 152 "A name server MAY limit the resources it devotes to TCP queries, 153 but it SHOULD NOT refuse to service a TCP query just because it 154 would have succeeded with UDP." 156 Culminating in [RFC1536], DNS over TCP came to be associated 157 primarily with the zone transfer mechanism, while most DNS queries 158 and responses were seen as the dominion of UDP. 160 2.2. Waiting for Large Messages and Reliability 162 In the original specifications, the maximum DNS over UDP message size 163 was enshrined at 512 bytes. However, even while [RFC1123] made a 164 clear preference for UDP, it foresaw DNS over TCP becoming more 165 popular in the future to overcome this limitation: 167 "[...] it is also clear that some new DNS record types defined in 168 the future will contain information exceeding the 512 byte limit 169 that applies to UDP, and hence will require TCP. 171 At least two new, widely anticipated developments were set to elevate 172 the need for DNS over TCP transactions. The first was dynamic 173 updates defined in [RFC2136] and the second was the set of extensions 174 collectively known as DNSSEC originally specified in [RFC2541]. The 175 former suggested "requestors who require an accurate response code 176 must use TCP", while the later warned "[...] larger keys increase the 177 size of KEY and SIG RRs. This increases the chance of DNS UDP packet 178 overflow and the possible necessity for using higher overhead TCP in 179 responses." 181 Yet defying some expectations, DNS over TCP remained little used in 182 real traffic across the Internet. Dynamic updates saw little 183 deployment between autonomous networks. Around the time DNSSEC was 184 first defined, another new feature helped solidify UDP's transport 185 dominance for message transactions. 187 2.3. EDNS0 189 In 1999 the IETF published the Extension Mechanisms for DNS (EDNS0) 190 in [RFC2671] (superseded in 2013 by an update in [RFC6891]). This 191 document standardized a way for communicating DNS nodes to perform 192 rudimentary capabilities negotiation. One such capability written 193 into the base specification and present in every ENDS0 compatible 194 message is the value of the maximum UDP payload size the sender can 195 support. This unsigned 16-bit field specifies in bytes the maximum 196 (possibly fragmented) DNS message size a node is capable of 197 receiving. In practice, typical values are a subset of the 512 to 198 4096 byte range. EDNS0 became widely deployed over the next several 199 years and numerous surveys have shown many systems currently support 200 larger UDP MTUs [CASTRO2010], [NETALYZR] with EDNS0. 202 The natural effect of EDNS0 deployment meant DNS messages larger than 203 512 bytes would be less reliant on TCP than they might otherwise have 204 been. While a non-negligible population of DNS systems lack EDNS0 or 205 may still fall back to TCP for some transactions, DNS over TCP 206 transactions remain a very small fraction of overall DNS traffic 207 [VERISIGN]. 209 2.4. Fragmentation and Truncation 211 Although EDNS0 provides a way for endpoints to signal support for DNS 212 messages exceeding 512 bytes, the realities of a diverse and 213 inconsistently deployed Internet may result in some large messages 214 being unable to reach their destination. Any IP datagram whose size 215 exceeds the MTU of a link it transits will be fragmented and then 216 reassembled by the receiving host. Unfortunately, it is not uncommon 217 for middleboxes and firewalls to block IP fragments. If one or more 218 fragments do not arrive, the application does not receive the message 219 and the request times out. 221 For IPv4-connected hosts, the de-facto MTU is often the Ethernet 222 payload size of 1500 bytes. This means that the largest unfragmented 223 UDP DNS message that can be sent over IPv4 is likely 1472 bytes. For 224 IPv6, the situation is a little more complicated. First, IPv6 225 headers are 40 bytes (versus 20 without option in IPv4). Second, it 226 seems as though some people have mis-interpreted IPv6's required 227 minimum MTU of 1280 as a required maximum. Third, fragmentation in 228 IPv6 can only be done by the host originating the datagram. The need 229 to fragment is conveyed in an ICMPv6 "packet too big" message. The 230 originating host indicates a fragmented datagram with IPv6 extension 231 headers. Unfortunately, it is quite common for both ICMPv6 and IPv6 232 extension headers to be blocked by middleboxes. According to 233 [HUSTON] some 35% of IPv6-capable recursive resolvers are unable to 234 receive a fragmented IPv6 packet. 236 The practical consequence of all this is that DNS requestors must be 237 prepared to retry queries with different EDNS0 maximum message size 238 values. Administrators of BIND are likely to be familiar with seeing 239 "success resolving ... after reducing the advertised EDNS0 UDP packet 240 size to 512 octets" messages in their system logs. 242 Often, reducing the EDNS0 UDP packet size leads to a successful 243 response. That is, the necessary data fits within the smaller 244 message size. However, when the data does not fit, the server sets 245 the truncated flag in its response, indicating the client should 246 retry over TCP to receive the whole response. This is undesirable 247 from the client's point of view because it adds more latency, and 248 potentially undesirable from the server's point of view due to the 249 increased resource requirements of TCP. 251 The issues around fragmentation, truncation, and TCP are driving 252 certain implementation and policy decisions in the DNS. Notably, 253 Cloudflare implemented what it calls "DNSSEC black lies" [CLOUDFLARE] 254 and uses ECDSA algorithms, such that their signed responses fit 255 easily in 512 bytes. The KSK Rollover design team [DESIGNTEAM] spent 256 a lot of time thinking and worrying about response sizes. There is 257 growing sentiment in the DNSSEC community that RSA key sizes beyond 258 2048-bits are impractical and that critical infrastructure zones 259 should transition to elliptic curve algorithms to keep response sizes 260 manageable. 262 2.5. "Only Zone Transfers Use TCP" 264 Today, the majority of the DNS community expects, or at least has a 265 desire, to see DNS over TCP transactions to occur without 266 interference. However there has also been a long held belief by some 267 operators, particularly for security-related reasons, that DNS over 268 TCP services should be purposely limited or not provided at all 269 [CHES94], [DJBDNS]. A popular meme has also held the imagination of 270 some that DNS over TCP is only ever used for zone transfers and is 271 generally unnecessary otherwise, with filtering all DNS over TCP 272 traffic even described as a best practice. 274 The position on restricting DNS over TCP had some justification given 275 that historic implementations of DNS nameservers provided very little 276 in the way of TCP connection management (for example see 277 Section 6.1.2 of [RFC7766] for more details). However modern 278 standards and implementations are moving to align with the more 279 sophisticated TCP management techniques employed by, for example, 280 HTTP(S) servers and load balancers. 282 3. DNS over TCP Requirements 284 An average increase in DNS message size, the continued development of 285 new DNS features and a denial of service mitigation technique (see 286 Section 9) have suggested that DNS over TCP transactions are as 287 important to the correct and safe operation of the Internet DNS as 288 ever, if not more so. Furthermore, there has been serious research 289 that has suggested connection-oriented DNS transactions may provide 290 security and privacy advantages over UDP transport [TDNS]. In fact, 291 [RFC7858], a Standards Track document is just this sort of 292 specification. Therefore, we now believe it is undesirable for 293 network operators to artificially inhibit the potential utility and 294 advances in the DNS such as these. 296 TODO: I think the text below needs some work/discussion because 7766 297 already updated 1123 in a very similar way except that 7766 speaks of 298 "implement" and this one speaks of "service". 1123 speaks of 299 "support" and doesn't distinguish between implement/service. 301 Section 6.1.3.2 in [RFC1123] is updated: All general-purpose DNS 302 servers MUST be able to service both UDP and TCP queries. 304 o Authoritative servers MUST service TCP queries so that they do not 305 limit the size of responses to what fits in a single UDP packet. 307 o Recursive servers (or forwarders) MUST service TCP queries so that 308 they do not prevent large responses from a TCP-capable server from 309 reaching its TCP-capable clients. 311 Regarding the choice of limiting the resources a server devotes to 312 queries, Section 6.1.3.2 in [RFC1123] also says: 314 "A name server MAY limit the resources it devotes to TCP queries, 315 but it SHOULD NOT refuse to service a TCP query just because it 316 would have succeeded with UDP." 318 This requirement is hereby updated: A name server MAY limit the the 319 resources it devotes to queries, but it MUST NOT refuse to service a 320 query just because it would have succeeded with another transport 321 protocol. 323 Filtering of DNS over TCP is considered harmful in the general case. 324 DNS resolver and server operators MUST provide DNS service over both 325 UDP and TCP transports. Likewise, network operators MUST allow DNS 326 service over both UDP and TCP transports. It must be acknowledged 327 that DNS over TCP service can pose operational challenges that are 328 not present when running DNS over UDP alone, and vice-versa. 329 However, it is the aim of this document to argue that the potential 330 damage incurred by prohibiting DNS over TCP service is more 331 detrimental to the continued utility and success of the DNS than when 332 its usage is allowed. 334 4. Network and System Considerations 336 This section describes measures that systems and applications can 337 take to optimize performance over TCP and to protect themselves from 338 TCP-based resource exhaustion and attacks. 340 4.1. Connection Admission 342 The SYN flooding attack is a denial-of-service method affecting hosts 343 that run TCP server processes [RFC4987]. This attack can be very 344 effective if not mitigated. One of the most effective mitigation 345 techniques is SYN cookies, which allows the server to avoid 346 allocating any state until the successful completion of the three-way 347 handshake. 349 Services not intended for use by the public Internet, such as most 350 recursive name servers, SHOULD be protected with access controls. 351 Ideally these controls are placed in the network, well before before 352 any unwanted TCP packets can reach the DNS server host or 353 application. If this is not possible, the controls can be placed in 354 the application itself. In some situations (e.g. attacks) it may be 355 necessary to deploy access controls for DNS services that should 356 otherwise be globally reachable. 358 The FreeBSD operating system has an "accept filter" feature that 359 postpones delivery of TCP connections to applications until a 360 complete, valid request has been received. The dns_accf(9) filter 361 ensures that a valid DNS message is received. If not, the bogus 362 connection never reaches the application. Applications must be coded 363 and configured to make use of this filter. 365 Per [RFC7766], applications and administrators are advised to 366 remember that TCP MAY be used before sending any UDP queries. 367 Networks and applications MUST NOT be configured to refuse TCP 368 queries that were not preceded by a UDP query. 370 TCP Fast Open [RFC7413] (TFO) allows TCP clients to shorten the 371 handshake for subsequent connections to the same server. TFO saves 372 one round-trip time in the connection setup. DNS servers SHOULD 373 enable TFO when possible. Furthermore, DNS servers clustered behind 374 a single service address (e.g., anycast or load-balancing), SHOULD 375 use the same TFO server key on all instances. 377 DNS clients SHOULD also enable TFO when possible. Currently, on some 378 operating systems it is not implemented or disabled by default. 379 [WIKIPEDIA_TFO] describes applications and operating systems that 380 support TFO. 382 4.2. Connection Management 384 Since host memory for TCP state is a finite resource, DNS servers 385 MUST actively manage their connections. Applications that do not 386 actively manage their connections can encounter resource exhaustion 387 leading to denial of service. For DNS, as in other protocols, there 388 is a tradeoff between keeping connections open for potential future 389 use and the need to free up resources for new connections that will 390 arrive. 392 DNS server software SHOULD provide a configurable limit on the total 393 number of established TCP connections. If the limit is reached, the 394 application is expected to either close existing (idle) connections 395 or refuse new connections. Operators SHOULD ensure the limit is 396 configured appropriately for their particular situation. 398 DNS server software MAY provide a configurable limit on the number of 399 established connections per source IP address or subnet. This can be 400 used to ensure that a single or small set of users can not consume 401 all TCP resources and deny service to other users. Operators SHOULD 402 ensure this limit is configured appropriately, based on their number 403 of diversity of users. 405 DNS server software SHOULD provide a configurable timeout for idle 406 TCP connections. For very busy name servers this might be set to a 407 low value, such as a few seconds. For less busy servers it might be 408 set to a higher value, such as tens of seconds. DNS clients and 409 servers SHOULD signal their timeout values using the edns-tcp- 410 keepalive option [RFC7828]. 412 DNS server software MAY provide a configurable limit on the number of 413 transactions per TCP connection. This document does not offer advice 414 on particular values for such a limit. 416 Similarly, DNS server software MAY provide a configurable limit on 417 the total duration of a TCP connection. This document does not offer 418 advice on particular values for such a limit. 420 Since clients may not be aware of server-imposed limits, clients 421 utilizing TCP for DNS need to always be prepared to re-establish 422 connections or otherwise retry outstanding queries. 424 4.3. Connection Termination 426 In general, it is preferable for clients to initiate the close of a 427 TCP connection. The TCP peer that initiates a connection close 428 retains the socket in the TIME_WAIT state for some amount of time, 429 possibly a few minutes. On a busy server, the accumulation of many 430 sockets in TIME_WAIT can cause performance problems or even denial of 431 service. 433 On systems where large numbers of sockets in TIME_WAIT are observed, 434 it may be beneficial to tune the local TCP parameters. For example, 435 the Linux kernel provides a number of "sysctl" parameters related to 436 TIME_WAIT, such as net.ipv4.tcp_fin_timeout, net.ipv4.tcp_tw_recycle, 437 and net.ipv4.tcp_tw_reuse. In extreme cases, implementors and 438 operators of very busy servers may find it necessary to utilize the 439 SO_LINGER socket option ([Stevens] Section 7.5) with a value of zero 440 so that the server doesn't accumulate TIME_WAIT sockets. 442 5. DNS over TCP Filtering Risks 444 Networks that filter DNS over TCP risk losing access to significant 445 or important pieces of the DNS name space. For a variety of reasons 446 a DNS answer may require a DNS over TCP query. This may include 447 large message sizes, lack of EDNS0 support, DDoS mitigation 448 techniques, or perhaps some future capability that is as yet 449 unforeseen will also demand TCP transport. 451 For example, [RFC7901] describes a latency-avoiding technique that 452 sends extra data in DNS responses. This makes responses larger and 453 potentially increases the risk of DDoS reflection attacks. The 454 specification mandates the use of TCP or DNS Cookies ([RFC7873]). 456 Even if any or all particular answers have consistently been returned 457 successfully with UDP in the past, this continued behavior cannot be 458 guaranteed when DNS messages are exchanged between autonomous 459 systems. Therefore, filtering of DNS over TCP is considered harmful 460 and contrary to the safe and successful operation of the Internet. 461 This section enumerates some of the known risks we know about at the 462 time of this writing when networks filter DNS over TCP. 464 5.1. DNS Wedgie 466 Networks that filter DNS over TCP may inadvertently cause problems 467 for third party resolvers as experienced by [TOYAMA]. If for 468 instance a resolver receives a truncated answer from a server, but 469 when the resolver resends the query using TCP and the TCP response 470 never arrives, not only will full answer be unavailable, but the 471 resolver will incur the full extent of TCP retransmissions and time 472 outs. This situation might place extreme strain on resolver 473 resources. If the number and frequency of these truncated answers 474 are sufficiently high, we refer to the steady-state of lost resources 475 as a result a "DNS" wedgie". A DNS wedgie is often not easily or 476 completely mitigated by the affected DNS resolver operator. 478 5.2. DNS Root Zone KSK Rollover 480 Recent plans for a new root zone DNSSEC KSK have highlighted a 481 potential problem in retrieving the keys [LEWIS]. Some packets in 482 the KSK rollover process will be larger than 1280 bytes, the IPv6 483 minimum MTU for links carrying IPv6 traffic.[RFC2460] While studies 484 have shown that problems due to fragment filtering or an inability to 485 generate and receive these larger messages are negligible, any DNS 486 server that is unable to receive large DNS over UDP messages or 487 perform DNS over TCP may experience severe disruption of DNS service 488 if performing DNSSEC validation. 490 TODO: Is this "overcome by events" now? We've had 1414 byte DNSKEY 491 responses at the three ZSK rollover periods since KSK-2017 became 492 published in the root zone. 494 5.3. DNS-over-TLS 496 DNS messages may be sent over TLS to provide privacy between stubs 497 and recursive resolvers. [RFC7858] is a standards track document 498 describing how this works. Although it utilizes TCP port 853 instead 499 of port 53, this document applies equally well to DNS-over-TLS. 500 Note, however, DNS-over-TLS is currently only defined between stubs 501 and recursives. 503 The use of TLS places even strong operational burdens on DNS clients 504 and servers. Cryptographic functions for authentication and 505 encryption require additional processing. Unoptimized connection 506 setup takes two additional round-trips compared to TCP, but can be 507 reduced with Fast TLS connection resumption [RFC5077] and TLS False 508 Start [RFC7918]. 510 6. Logging and Monitoring 512 Developers of applications that log or monitor DNS are advised to not 513 ignore TCP because it is rarely used or because it is hard to 514 process. Operators are advised to ensure that their monitoring and 515 logging applications properly capture DNS-over-TCP messages. 516 Otherwise, attacks, exfiltration attempts, and normal traffic may go 517 undetected. 519 DNS messages over TCP are in no way guaranteed to arrive in single 520 segments. In fact, a clever attacker may attempt to hide certain 521 messages by forcing them over very small TCP segments. Applications 522 that capture network packets (e.g., with libpcap) should be prepared 523 to implement and perform full TCP segment reassembly. dnscap 524 [dnscap] is an open-source example of a DNS logging program that 525 implements TCP reassembly. 527 Developers should also keep in mind connection reuse, pipelining, and 528 out-of-order responses when building and testing DNS monitoring 529 applications. 531 7. Acknowledgments 533 This document was initially motivated by feedback from students who 534 pointed out that they were hearing contradictory information about 535 filtering DNS over TCP messages. Thanks in particular to a teaching 536 colleague, JPL, who perhaps unknowingly encouraged the initial 537 research into the differences of what the community has historically 538 said and did. Thanks to all the NANOG 63 attendees who provided 539 feedback to an early talk on this subject. 541 The following individuals provided an array of feedback to help 542 improve this document: Sara Dickinson, Bob Harold, Tatuya Jinmei, and 543 Paul Hoffman. The authors are indebted to their contributions. Any 544 remaining errors or imperfections are the sole responsibility of the 545 document authors. 547 8. IANA Considerations 549 This memo includes no request to IANA. 551 9. Security Considerations 553 Ironically, returning truncated DNS over UDP answers in order to 554 induce a client query to switch to DNS over TCP has become a common 555 response to source address spoofed, DNS denial-of-service attacks 556 [RRL]. Historically, operators have been wary of TCP-based attacks, 557 but in recent years, UDP-based flooding attacks have proven to be the 558 most common protocol attack on the DNS. Nevertheless, a high rate of 559 short-lived DNS transactions over TCP may pose challenges. While 560 many operators have provided DNS over TCP service for many years 561 without duress, past experience is no guarantee of future success. 563 DNS over TCP is not unlike many other Internet TCP services. TCP 564 threats and many mitigation strategies have been well documented in a 565 series of documents such as [RFC4953], [RFC4987], [RFC5927], and 566 [RFC5961]. 568 10. Privacy Considerations 570 TODO: Does this document warrant privacy considerations? 572 11. References 574 11.1. Normative References 576 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 577 Requirement Levels", BCP 14, RFC 2119, 578 DOI 10.17487/RFC2119, March 1997, 579 . 581 11.2. Informative References 583 [CASTRO2010] 584 Castro, S., Zhang, M., John, W., Wessels, D., and k. 585 claffy, "Understanding and preparing for DNS evolution", 586 2010. 588 [CHES94] Cheswick, W. and S. Bellovin, "Firewalls and Internet 589 Security: Repelling the Wily Hacker", 1994. 591 [CLOUDFLARE] 592 Grant, D., "Economical With The Truth: Making DNSSEC 593 Answers Cheap", June 2016, 594 . 596 [DESIGNTEAM] 597 Design Team Report, "Root Zone KSK Rollover Plan", 598 December 2015, . 601 [DJBDNS] D.J. Bernstein, "When are TCP queries sent?", 2002, 602 . 604 [dnscap] DNS-OARC, "DNSCAP", May 2018, 605 . 607 [HUSTON] Huston, G., "Dealing with IPv6 fragmentation in the DNS", 608 August 2017, . 611 [LEWIS] Lewis, E., "2017 DNSSEC KSK Rollover", RIPE 74 Budapest, 612 Hungary, May 2017, . 615 [NETALYZR] 616 Kreibich, C., Weaver, N., Nechaev, B., and V. Paxson, 617 "Netalyzr: Illuminating The Edge Network", 2010. 619 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 620 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 621 . 623 [RFC1035] Mockapetris, P., "Domain names - implementation and 624 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 625 November 1987, . 627 [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - 628 Application and Support", STD 3, RFC 1123, 629 DOI 10.17487/RFC1123, October 1989, 630 . 632 [RFC1536] Kumar, A., Postel, J., Neuman, C., Danzig, P., and S. 633 Miller, "Common DNS Implementation Errors and Suggested 634 Fixes", RFC 1536, DOI 10.17487/RFC1536, October 1993, 635 . 637 [RFC2136] Vixie, P., Ed., Thomson, S., Rekhter, Y., and J. Bound, 638 "Dynamic Updates in the Domain Name System (DNS UPDATE)", 639 RFC 2136, DOI 10.17487/RFC2136, April 1997, 640 . 642 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 643 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, 644 December 1998, . 646 [RFC2541] Eastlake 3rd, D., "DNS Security Operational 647 Considerations", RFC 2541, DOI 10.17487/RFC2541, March 648 1999, . 650 [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", 651 RFC 2671, DOI 10.17487/RFC2671, August 1999, 652 . 654 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", 655 RFC 4953, DOI 10.17487/RFC4953, July 2007, 656 . 658 [RFC4987] Eddy, W., "TCP SYN Flooding Attacks and Common 659 Mitigations", RFC 4987, DOI 10.17487/RFC4987, August 2007, 660 . 662 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 663 "Transport Layer Security (TLS) Session Resumption without 664 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 665 January 2008, . 667 [RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, 668 DOI 10.17487/RFC5927, July 2010, 669 . 671 [RFC5936] Lewis, E. and A. Hoenes, Ed., "DNS Zone Transfer Protocol 672 (AXFR)", RFC 5936, DOI 10.17487/RFC5936, June 2010, 673 . 675 [RFC5961] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's 676 Robustness to Blind In-Window Attacks", RFC 5961, 677 DOI 10.17487/RFC5961, August 2010, 678 . 680 [RFC6304] Abley, J. and W. Maton, "AS112 Nameserver Operations", 681 RFC 6304, DOI 10.17487/RFC6304, July 2011, 682 . 684 [RFC6762] Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, 685 DOI 10.17487/RFC6762, February 2013, 686 . 688 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 689 for DNS (EDNS(0))", STD 75, RFC 6891, 690 DOI 10.17487/RFC6891, April 2013, 691 . 693 [RFC6950] Peterson, J., Kolkman, O., Tschofenig, H., and B. Aboba, 694 "Architectural Considerations on Application Features in 695 the DNS", RFC 6950, DOI 10.17487/RFC6950, October 2013, 696 . 698 [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP 699 Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, 700 . 702 [RFC7477] Hardaker, W., "Child-to-Parent Synchronization in DNS", 703 RFC 7477, DOI 10.17487/RFC7477, March 2015, 704 . 706 [RFC7720] Blanchet, M. and L-J. Liman, "DNS Root Name Service 707 Protocol and Deployment Requirements", BCP 40, RFC 7720, 708 DOI 10.17487/RFC7720, December 2015, 709 . 711 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 712 D. Wessels, "DNS Transport over TCP - Implementation 713 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 714 . 716 [RFC7828] Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The 717 edns-tcp-keepalive EDNS0 Option", RFC 7828, 718 DOI 10.17487/RFC7828, April 2016, 719 . 721 [RFC7858] Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., 722 and P. Hoffman, "Specification for DNS over Transport 723 Layer Security (TLS)", RFC 7858, DOI 10.17487/RFC7858, May 724 2016, . 726 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 727 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 728 . 730 [RFC7901] Wouters, P., "CHAIN Query Requests in DNS", RFC 7901, 731 DOI 10.17487/RFC7901, June 2016, 732 . 734 [RFC7918] Langley, A., Modadugu, N., and B. Moeller, "Transport 735 Layer Security (TLS) False Start", RFC 7918, 736 DOI 10.17487/RFC7918, August 2016, 737 . 739 [RFC8027] Hardaker, W., Gudmundsson, O., and S. Krishnaswamy, 740 "DNSSEC Roadblock Avoidance", BCP 207, RFC 8027, 741 DOI 10.17487/RFC8027, November 2016, 742 . 744 [RFC8094] Reddy, T., Wing, D., and P. Patil, "DNS over Datagram 745 Transport Layer Security (DTLS)", RFC 8094, 746 DOI 10.17487/RFC8094, February 2017, 747 . 749 [RFC8162] Hoffman, P. and J. Schlyter, "Using Secure DNS to 750 Associate Certificates with Domain Names for S/MIME", 751 RFC 8162, DOI 10.17487/RFC8162, May 2017, 752 . 754 [RRL] Vixie, P. and V. Schryver, "DNS Response Rate Limiting 755 (DNS RRL)", ISC-TN 2012-1 Draft1, April 2012. 757 [Stevens] Stevens, W., Fenner, B., and A. Rudoff, "UNIX Network 758 Programming Volume 1, Third Edition: The Sockets 759 Networking API", November 2003. 761 [TDNS] Zhu, L., Heidemann, J., Wessels, D., Mankin, A., and N. 762 Somaiya, "Connection-oriented DNS to Improve Privacy and 763 Security", 2015. 765 [TOYAMA] Toyama, K., Ishibashi, K., Ishino, M., Yoshimura, C., and 766 K. Fujiwara, "DNS Anomalies and Their Impacts on DNS Cache 767 Servers", NANOG 32 Reston, VA USA, 2004. 769 [VERISIGN] 770 Thomas, M. and D. Wessels, "An Analysis of TCP Traffic in 771 Root Server DITL Data", DNS-OARC 2014 Fall Workshop Los 772 Angeles, 2014. 774 [WIKIPEDIA_TFO] 775 Wikipedia, "TCP Fast Open", May 2018, 776 . 778 Appendix A. Standards Related to DNS Transport over TCP 780 This section enumerates all known IETF RFC documents that are 781 currently of status standard, informational, best common practice or 782 experimental and either implicitly or explicitly make assumptions or 783 statements about the use of TCP as a transport for the DNS germane to 784 this document. 786 A.1. TODO - additional, relevant RFCs 788 A.2. IETF RFC 5936 - DNS Zone Transfer Protocol (AXFR) 790 The [RFC5936] standards track document provides a detailed 791 specification for the zone transfer protocol, as originally outlined 792 in the early DNS standards. AXFR operation is limited to TCP and not 793 specified for UDP. This document discusses TCP usage at length. 795 A.3. IETF RFC 6304 - AS112 Nameserver Operations 797 [RFC6304] is an informational document enumerating the requirements 798 for operation of AS112 project DNS servers. New AS112 nodes are 799 tested for their ability to provide service on both UDP and TCP 800 transports, with the implication that TCP service is an expected part 801 of normal operations. 803 A.4. IETF RFC 6762 - Multicast DNS 805 This standards track document [RFC6762] the TC bit is deemed to have 806 essentially the same meaning as described in the original DNS 807 specifications. That is, if a response with the TCP bit set is 808 receiver "[...] the querier SHOULD reissue its query using TCP in 809 order to receive the larger response." 811 A.5. IETF RFC 6950 - Architectural Considerations on Application 812 Features in the DNS 814 An informational document [RFC6950] that draws attention to large 815 data in the DNS. TCP is referenced in the context as a common 816 fallback mechnanism and counter to some spoofing attacks. 818 A.6. IETF RFC 7477 - Child-to-Parent Synchronization in DNS 820 This standards track document [RFC7477] specifies a RRType and 821 protocol to signal and synchronize NS, A, and AAAA resource record 822 changes from a child to parent zone. Since this protocol may require 823 multiple requests and responses, it recommends utilizing DNS over TCP 824 to ensure the conversation takes place between a consistent pair of 825 end nodes. 827 A.7. IETF RFC 7720 - DNS Root Name Service Protocol and Deployment 828 Requirements 830 This best current practice[RFC7720] declares root name service "MUST 831 support UDP [RFC768] and TCP [RFC793] transport of DNS queries and 832 responses." 834 A.8. IETF RFC 7766 - DNS Transport over TCP - Implementation 835 Requirements 837 The standards track document [RFC7766] might be considered the direct 838 ancestor of this operational requirements document. The 839 implementation requirements document codifies mandatory support for 840 DNS over TCP in compliant DNS software. 842 A.9. IETF RFC 7828 - The edns-tcp-keepalive EDNS0 Option 844 This standards track document [RFC7828] defines an EDNS0 option to 845 negotiate an idle timeout value for long-lived DNS over TCP 846 connections. Consequently, this document is only applicable and 847 relevant to DNS over TCP sessions and between implementations that 848 support this option. 850 A.10. IETF RFC 7858 - Specification for DNS over Transport Layer 851 Security (TLS) 853 This standards track document [RFC7858] defines a method for putting 854 DNS messages into a TCP-based encrypted channel using TLS. This 855 specification is noteworthy for explicitly targetting the stub-to- 856 recursive traffic, but does not preclude its application from 857 recursive-to-authoritative traffic. 859 A.11. IETF RFC 7873 - Domain Name System (DNS) Cookies 861 This standards track document [RFC7873] describes an EDNS0 option to 862 provide additional protection against query and answer forgery. This 863 specification mentions DNS over TCP as a reasonable fallback 864 mechanism when DNS Cookies are not available. The specification does 865 make mention of DNS over TCP processing in two specific situations. 866 In one, when a server receives only a client cookie in a request, the 867 server should consider whether the request arrived over TCP and if 868 so, it should consider accepting TCP as sufficient to authenticate 869 the request and respond accordingly. In another, when a client 870 receives a BADCOOKIE reply using a fresh server cookie, the client 871 should retry using TCP as the transport. 873 A.12. IETF RFC 7901 - CHAIN Query Requests in DNS 875 This experimental specification [RFC7901] describes an EDNS0 option 876 that can be used by a security-aware validating resolver to request 877 and obtain a complete DNSSEC validation path for any single query. 878 This document requires the use of DNS over TCP or a source IP address 879 verified transport mechanism such as EDNS-COOKIE.[RFC7873] 881 A.13. IETF RFC 8027 - DNSSEC Roadblock Avoidance 883 This document [RFC8027] details observed problems with DNSSEC 884 deployment and mitigation techniques. Network traffic blocking and 885 restrictions, including DNS over TCP messages, are highlighted as one 886 reason for DNSSEC deployment issues. While this document suggests 887 these sorts of problems are due to "non-compliant infrastructure" and 888 is of type BCP, the scope of the document is limited to detection and 889 mitigation techniques to avoid so-called DNSSEC roadblocks. 891 A.14. IETF RFC 8094 - DNS over Datagram Transport Layer Security (DTLS) 893 This experimental specification [RFC8094] details a protocol that 894 uses a datagram transport (UDP), but stipulates that "DNS clients and 895 servers that implement DNS over DTLS MUST also implement DNS over TLS 896 in order to provide privacy for clients that desire Strict Privacy 897 [...]". This requirement implies DNS over TCP must be supported in 898 case the message size is larger than the path MTU. 900 A.15. IETF RFC 8162 - Using Secure DNS to Associate Certificates with 901 Domain Names for S/MIME 903 This experimental specification [RFC8162] describes a technique to 904 authenticate user X.509 certificates in an S/MIME system via the DNS. 905 The document points out that the new experimental resource record 906 types are expected to carry large payloads, resulting in the 907 suggestion that "applications SHOULD use TCP -- not UDP -- to perform 908 queries for the SMIMEA resource record." 910 Authors' Addresses 912 John Kristoff 913 DePaul University 914 Chicago, IL 60604 915 US 917 Phone: +1 312 493 0305 918 Email: jtk@depaul.edu 919 URI: https://aharp.iorc.depaul.edu 921 Duane Wessels 922 Verisign 923 12061 Bluemont Way 924 Reston, VA 20190 925 US 927 Phone: +1 703 948 3200 928 Email: dwessels@verisign.com 929 URI: http://verisigninc.com