idnits 2.17.1 draft-ietf-doh-dns-over-https-13.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 -- The document date (August 08, 2018) is 2087 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 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7232 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7234 (Obsoleted by RFC 9111) ** Obsolete normative reference: RFC 7235 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) ** Obsolete normative reference: RFC 7626 (Obsoleted by RFC 9076) -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) Summary: 8 errors (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Hoffman 3 Internet-Draft ICANN 4 Intended status: Standards Track P. McManus 5 Expires: February 9, 2019 Mozilla 6 August 08, 2018 8 DNS Queries over HTTPS (DoH) 9 draft-ietf-doh-dns-over-https-13 11 Abstract 13 This document defines a protocol for sending DNS queries and getting 14 DNS responses over HTTPS. Each DNS query-response pair is mapped 15 into an HTTP exchange. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at https://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on February 9, 2019. 34 Copyright Notice 36 Copyright (c) 2018 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (https://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 3. Protocol Requirements . . . . . . . . . . . . . . . . . . . . 3 54 3.1. Non-requirements . . . . . . . . . . . . . . . . . . . . 4 55 4. Selection of DoH Server . . . . . . . . . . . . . . . . . . . 4 56 5. The HTTP Exchange . . . . . . . . . . . . . . . . . . . . . . 4 57 5.1. The HTTP Request . . . . . . . . . . . . . . . . . . . . 4 58 5.1.1. HTTP Request Examples . . . . . . . . . . . . . . . . 5 59 5.2. The HTTP Response . . . . . . . . . . . . . . . . . . . . 7 60 5.2.1. Handling DNS and HTTP Errors . . . . . . . . . . . . 7 61 5.2.2. HTTP Response Example . . . . . . . . . . . . . . . . 7 62 6. HTTP Integration . . . . . . . . . . . . . . . . . . . . . . 8 63 6.1. Cache Interaction . . . . . . . . . . . . . . . . . . . . 8 64 6.2. HTTP/2 . . . . . . . . . . . . . . . . . . . . . . . . . 10 65 6.3. Server Push . . . . . . . . . . . . . . . . . . . . . . . 10 66 6.4. Content Negotiation . . . . . . . . . . . . . . . . . . . 10 67 7. Definition of the application/dns-message media type . . . . 10 68 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 69 8.1. Registration of application/dns-message Media Type . . . 11 70 9. Privacy Considerations . . . . . . . . . . . . . . . . . . . 13 71 9.1. On The Wire . . . . . . . . . . . . . . . . . . . . . . . 13 72 9.2. In The Server . . . . . . . . . . . . . . . . . . . . . . 13 73 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 74 11. Operational Considerations . . . . . . . . . . . . . . . . . 15 75 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 76 12.1. Normative References . . . . . . . . . . . . . . . . . . 17 77 12.2. Informative References . . . . . . . . . . . . . . . . . 18 78 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 20 79 Previous Work on DNS over HTTP or in Other Formats . . . . . . . 20 80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 21 82 1. Introduction 84 This document defines a specific protocol for sending DNS [RFC1035] 85 queries and getting DNS responses over HTTP [RFC7540] using https 86 URIs (and therefore TLS [RFC5246] security for integrity and 87 confidentiality). Each DNS query-response pair is mapped into an 88 HTTP exchange. 90 The described approach is more than a tunnel over HTTP. It 91 establishes default media formatting types for requests and responses 92 but uses normal HTTP content negotiation mechanisms for selecting 93 alternatives that endpoints may prefer in anticipation of serving new 94 use cases. In addition to this media type negotiation, it aligns 95 itself with HTTP features such as caching, redirection, proxying, 96 authentication, and compression. 98 The integration with HTTP provides a transport suitable for both 99 existing DNS clients and native web applications seeking access to 100 the DNS. 102 Two primary uses cases were considered during this protocol's 103 development. They included preventing on-path devices from 104 interfering with DNS operations and allowing web applications to 105 access DNS information via existing browser APIs in a safe way 106 consistent with Cross Origin Resource Sharing (CORS) [CORS]. No 107 special effort has been taken to enable or prevent application to 108 other use cases. This document focuses on communication between DNS 109 clients (such as operating system stub resolvers) and recursive 110 resolvers. 112 2. Terminology 114 A server that supports this protocol is called a "DoH server" to 115 differentiate it from a "DNS server" (one that only provides DNS 116 service over one or more of the other transport protocols 117 standardized for DNS). Similarly, a client that supports this 118 protocol is called a "DoH client". 120 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 121 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 122 "OPTIONAL" in this document are to be interpreted as described in BCP 123 14 [RFC2119] [RFC8174] when, and only when, they appear in all 124 capitals, as shown here. 126 3. Protocol Requirements 128 [[ RFC Editor: Please remove this entire section before publication. 129 ]] 131 The protocol described here bases its design on the following 132 protocol requirements: 134 o The protocol must use normal HTTP semantics. 136 o The queries and responses must be able to be flexible enough to 137 express every DNS query that would normally be sent in DNS over 138 UDP (including queries and responses that use DNS extensions, but 139 not those that require multiple responses). 141 o The protocol must permit the addition of new formats for DNS 142 queries and responses. 144 o The protocol must ensure interoperability by specifying a single 145 format for requests and responses that is mandatory to implement. 147 That format must be able to support future modifications to the 148 DNS protocol including the inclusion of one or more EDNS options 149 (including those not yet defined). 151 o The protocol must use a secure transport that meets the 152 requirements for HTTPS. 154 3.1. Non-requirements 156 o Supporting network-specific DNS64 [RFC6147] 158 o Supporting other network-specific inferences from plaintext DNS 159 queries 161 o Supporting insecure HTTP 163 4. Selection of DoH Server 165 Configuration, discovery, and updating of the URI Template [RFC6570] 166 (see Section 5.1) is done out of band from this protocol. Note that 167 configuration might be manual (such as a user typing URI Templates in 168 a user interface for "options") or automatic (such as URI Templates 169 being supplied in responses from DHCP or similar protocols). DoH 170 Servers MAY support more than one URI Template. This allows the 171 different endpoints to have different properties such as different 172 authentication requirements or service level guarantees. 174 A DoH client uses configuration to select the URI, and thus the DoH 175 server, that is to be used for resolution. [RFC2818] defines how 176 HTTPS verifies the DoH server's identity. 178 A DoH client MUST NOT use a different URI simply because it was 179 discovered outside of the client's configuration, or because a server 180 offers an unsolicited response that appears to be a valid answer to a 181 DNS query. This specification does not extend DNS resolution 182 privileges to URIs that are not recognized by the DoH client as 183 configured URIs. Such scenarios may create additional operational, 184 tracking, and security hazards that require limitations for safe 185 usage. A future specification may support this use case. 187 5. The HTTP Exchange 189 5.1. The HTTP Request 191 A DoH client encodes a single DNS query into an HTTP request using 192 either the HTTP GET or POST method and the other requirements of this 193 section. The DoH server defines the URI used by the request through 194 the use of a URI Template. 196 The URI Template defined in this document is processed without any 197 variables when the HTTP method is POST. When the HTTP method is GET 198 the single variable "dns" is defined as the content of the DNS 199 request (as described in Section 7), encoded with base64url 200 [RFC4648]. 202 Future specifications for new media types MUST define the variables 203 used for URI Template processing with this protocol. 205 DoH servers MUST implement both the POST and GET methods. 207 When using the POST method the DNS query is included as the message 208 body of the HTTP request and the Content-Type request header field 209 indicates the media type of the message. POST-ed requests are 210 smaller than their GET equivalents. 212 Using the GET method is friendlier to many HTTP cache 213 implementations. 215 The DoH client SHOULD include an HTTP "Accept" request header field 216 to indicate what type of content can be understood in response. 217 Irrespective of the value of the Accept request header field, the 218 client MUST be prepared to process "application/dns-message" (as 219 described in Section 7) responses but MAY also process any other type 220 it receives. 222 In order to maximize cache friendliness, DoH clients using media 223 formats that include DNS ID, such as application/dns-message, SHOULD 224 use a DNS ID of 0 in every DNS request. HTTP correlates the request 225 and response, thus eliminating the need for the ID in a media type 226 such as application/dns-message. The use of a varying DNS ID can 227 cause semantically equivalent DNS queries to be cached separately. 229 DoH clients can use HTTP/2 padding and compression in the same way 230 that other HTTP/2 clients use (or don't use) them. 232 5.1.1. HTTP Request Examples 234 These examples use HTTP/2 style formatting from [RFC7540]. 236 These examples use a DoH service with a URI Template of 237 "https://dnsserver.example.net/dns-query{?dns}" to resolve IN A 238 records. 240 The requests are represented as application/dns-message typed bodies. 242 The first example request uses GET to request www.example.com 243 :method = GET 244 :scheme = https 245 :authority = dnsserver.example.net 246 :path = /dns-query?dns=AAABAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB 247 accept = application/dns-message 249 The same DNS query for www.example.com, using the POST method would 250 be: 252 :method = POST 253 :scheme = https 254 :authority = dnsserver.example.net 255 :path = /dns-query 256 accept = application/dns-message 257 content-type = application/dns-message 258 content-length = 33 260 <33 bytes represented by the following hex encoding> 261 00 00 01 00 00 01 00 00 00 00 00 00 03 77 77 77 262 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 263 01 265 In this example, the 33 bytes are the DNS message in DNS wire format. 267 Finally, a GET based query for a.62characterlabel-makes-base64url- 268 distinct-from-standard-base64.example.com is shown as an example to 269 emphasize that the encoding alphabet of base64url is different than 270 regular base64 and that padding is omitted. 272 The DNS query, expressed in DNS wire format, is 94 bytes represented 273 by the following: 275 00 00 01 00 00 01 00 00 00 00 00 00 01 61 3e 36 276 32 63 68 61 72 61 63 74 65 72 6c 61 62 65 6c 2d 277 6d 61 6b 65 73 2d 62 61 73 65 36 34 75 72 6c 2d 278 64 69 73 74 69 6e 63 74 2d 66 72 6f 6d 2d 73 74 279 61 6e 64 61 72 64 2d 62 61 73 65 36 34 07 65 78 280 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 282 :method = GET 283 :scheme = https 284 :authority = dnsserver.example.net 285 :path = /dns-query? (no space or CR) 286 dns=AAABAAABAAAAAAAAAWE-NjJjaGFyYWN0ZXJsYWJl (no space or CR) 287 bC1tYWtlcy1iYXNlNjR1cmwtZGlzdGluY3QtZnJvbS1z (no space or CR) 288 dGFuZGFyZC1iYXNlNjQHZXhhbXBsZQNjb20AAAEAAQ 289 accept = application/dns-message 291 5.2. The HTTP Response 293 The only response type defined in this document is "application/dns- 294 message", but it is possible that other response formats will be 295 defined in the future. A DoH server MUST be able to process 296 application/dns-message request messages. 298 Different response media types will provide more or less information 299 from a DNS response. For example, one response type might include 300 information from the DNS header bytes while another might omit it. 301 The amount and type of information that a media type gives is solely 302 up to the format, and not defined in this protocol. 304 Each DNS request-response pair is matched to one HTTP exchange. The 305 responses may be processed and transported in any order using HTTP's 306 multi-streaming functionality ([RFC7540] Section 5). 308 Section 6.1 discusses the relationship between DNS and HTTP response 309 caching. 311 5.2.1. Handling DNS and HTTP Errors 313 DNS response codes indicate either success or failure for the DNS 314 query. A successful HTTP response with a 2xx status code ([RFC7231] 315 Section 6.3) can be used for any valid DNS response, regardless of 316 the DNS response code. For example, a successful 2xx HTTP status 317 code is used even with a DNS message whose DNS response code 318 indicates failure, such as SERVFAIL or NXDOMAIN. 320 HTTP responses with non-successful HTTP status codes do not contain 321 replies to the original DNS question in the HTTP request. DoH 322 clients need to use the same semantic processing of non-successful 323 HTTP status codes as other HTTP clients. This might mean that the 324 DoH client retries the query with the same DoH server, such as 325 authorization failures (HTTP status code 401 [RFC7235] Section 3.1). 326 It could also mean that the DoH client retries with a different DoH 327 server, such as for unsupported media types (HTTP status code 415, 328 [RFC7231] Section 6.5.13), or where the server cannot generate a 329 representation suitable for the client (HTTP status code 406, 330 [RFC7231] Section 6.5.6), and so on. 332 5.2.2. HTTP Response Example 334 This is an example response for a query for the IN AAAA records for 335 "www.example.com" with recursion turned on. The response bears one 336 answer record with an address of 2001:db8:abcd:12:1:2:3:4 and a TTL 337 of 3709 seconds. 339 :status = 200 340 content-type = application/dns-message 341 content-length = 61 342 cache-control = max-age=3709 344 <61 bytes represented by the following hex encoding> 345 00 00 81 80 00 01 00 01 00 00 00 00 03 77 77 77 346 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 1c 00 347 01 c0 0c 00 1c 00 01 00 00 0e 7d 00 10 20 01 0d 348 b8 ab cd 00 12 00 01 00 02 00 03 00 04 350 6. HTTP Integration 352 This protocol MUST be used with the https scheme URI [RFC7230]. 354 Section 9 and Section 10 discuss additional considerations for the 355 integration with HTTP. 357 6.1. Cache Interaction 359 A DoH exchange can pass through a hierarchy of caches that include 360 both HTTP- and DNS-specific caches. These caches may exist between 361 the DoH server and client, or on the DoH client itself. HTTP caches 362 are by design generic; that is, they do not understand this protocol. 363 Even if a DoH client has modified its cache implementation to be 364 aware of DoH semantics, it does not follow that all upstream caches 365 (for example, inline proxies, server-side gateways and Content 366 Delivery Networks) will be. 368 As a result, DoH servers need to carefully consider the HTTP caching 369 metadata they send in response to GET requests (POST requests are not 370 cacheable unless specific response header fields are sent; this is 371 not widely implemented, and not advised for DoH). 373 In particular, DoH servers SHOULD assign an explicit freshness 374 lifetime ([RFC7234] Section 4.2) so that the DoH client is more 375 likely to use fresh DNS data. This requirement is due to HTTP caches 376 being able to assign their own heuristic freshness (such as that 377 described in [RFC7234] Section 4.2.2), which would take control of 378 the cache contents out of the hands of the DoH server. 380 The assigned freshness lifetime of a DoH HTTP response MUST be less 381 than or equal to the smallest TTL in the Answer section of the DNS 382 response. A freshness lifetime equal to the smallest TTL in the 383 Answer section is RECOMMENDED. For example, if a HTTP response 384 carries three RRsets with TTLs of 30, 600, and 300, the HTTP 385 freshness lifetime should be 30 seconds (which could be specified as 386 "Cache-Control: max-age=30"). This requirement helps assure that 387 none of the RRsets contained in a DNS response are served stale from 388 an HTTP cache. 390 If the DNS response has no records in the Answer section, and the DNS 391 response has an SOA record in the Authority section, the response 392 freshness lifetime MUST NOT be greater than the MINIMUM field from 393 that SOA record (see [RFC2308]). 395 The stale-while-revalidate and stale-if-error Cache-Control 396 directives ([RFC5861]) could be well-suited to a DoH implementation 397 when allowed by server policy. Those mechanisms allow a client, at 398 the server's discretion, to reuse a cache entry that is no longer 399 fresh. In such a case, the client reuses all of a cached entry, or 400 none of it. 402 DoH servers also need to consider caching when generating responses 403 that are not globally valid. For instance, if a DoH server 404 customizes a response based on the client's identity, it would not 405 want to allow global reuse of that response. This could be 406 accomplished through a variety of HTTP techniques such as a Cache- 407 Control max-age of 0, or by using the Vary response header field 408 ([RFC7231] Section 7.1.4) to establish a secondary cache key 409 ([RFC7234] Section 4.1). 411 DoH clients MUST account for the Age response header field's value 412 ([RFC7234]) when calculating the DNS TTL of a response. For example, 413 if an RRset is received with a DNS TTL of 600, but the Age header 414 field indicates that the response has been cached for 250 seconds, 415 the remaining lifetime of the RRset is 350 seconds. This requirement 416 applies to both DoH client HTTP caches and DoH client DNS caches. 418 DoH clients can request an uncached copy of a response by using the 419 "no-cache" request cache control directive ([RFC7234], 420 Section 5.2.1.4) and similar controls. Note that some caches might 421 not honor these directives, either due to configuration or 422 interaction with traditional DNS caches that do not have such a 423 mechanism. 425 HTTP conditional requests ([RFC7232]) may be of limited value to DoH, 426 as revalidation provides only a bandwidth benefit and DNS 427 transactions are normally latency bound. Furthermore, the HTTP 428 response header fields that enable revalidation (such as "Last- 429 Modified" and "Etag") are often fairly large when compared to the 430 overall DNS response size, and have a variable nature that creates 431 constant pressure on the HTTP/2 compression dictionary [RFC7541]. 432 Other types of DNS data, such as zone transfers, may be larger and 433 benefit more from revalidation. 435 6.2. HTTP/2 437 HTTP/2 [RFC7540] is the minimum RECOMMENDED version of HTTP for use 438 with DoH. 440 The messages in classic UDP-based DNS [RFC1035] are inherently 441 unordered and have low overhead. A competitive HTTP transport needs 442 to support reordering, parallelism, priority, and header compression 443 to achieve similar performance. Those features were introduced to 444 HTTP in HTTP/2 [RFC7540]. Earlier versions of HTTP are capable of 445 conveying the semantic requirements of DoH but may result in very 446 poor performance. 448 6.3. Server Push 450 Before using DoH response data for DNS resolution, the client MUST 451 establish that the HTTP request URI can be used for the DoH query. 452 For HTTP requests initiated by the DoH client, this is implicit in 453 the selection of URI. For HTTP server push ([RFC7540] Section 8.2) 454 extra care must be taken to ensure that the pushed URI is one that 455 the client would have directed the same query to if the client had 456 initiated the request. 458 6.4. Content Negotiation 460 In order to maximize interoperability, DoH clients and DoH servers 461 MUST support the "application/dns-message" media type. Other media 462 types MAY be used as defined by HTTP Content Negotiation ([RFC7231] 463 Section 3.4). Those media types MUST be flexible enough to express 464 every DNS query that would normally be sent in DNS over UDP 465 (including queries and responses that use DNS extensions, but not 466 those that require multiple responses). 468 7. Definition of the application/dns-message media type 470 The data payload for the application/dns-message media type is a 471 single message of the DNS on-the-wire format defined in Section 4.2.1 472 of [RFC1035], which in turn refers to the full wire format defined in 473 Section 4.1 of that RFC. 475 Although [RFC1035] says "Messages carried by UDP are restricted to 476 512 bytes", that was later updated by [RFC6891]. This media type 477 restricts the maximum size of the DNS message to 65535 bytes. 479 Note that the wire format used in this media type is different than 480 the wire format used in [RFC7858] (which uses the format defined in 481 Section 4.2.2 of [RFC1035] that includes two length bytes). 483 DoH clients using this media type MAY have one or more EDNS options 484 [RFC6891] in the request. DoH servers using this media type MUST 485 ignore the value given for the EDNS UDP payload size in DNS requests. 487 When using the GET method, the data payload for this media type MUST 488 be encoded with base64url [RFC4648] and then provided as a variable 489 named "dns" to the URI Template expansion. Padding characters for 490 base64url MUST NOT be included. 492 When using the POST method, the data payload for this media type MUST 493 NOT be encoded and is used directly as the HTTP message body. 495 8. IANA Considerations 497 8.1. Registration of application/dns-message Media Type 498 To: ietf-types@iana.org 499 Subject: Registration of MIME media type 500 application/dns-message 502 MIME media type name: application 504 MIME subtype name: dns-message 506 Required parameters: n/a 508 Optional parameters: n/a 510 Encoding considerations: This is a binary format. The contents are a 511 DNS message as defined in RFC 1035. The format used here is for DNS 512 over UDP, which is the format defined in the diagrams in RFC 1035. 514 Security considerations: The security considerations for carrying 515 this data are the same for carrying DNS without encryption. 517 Interoperability considerations: None. 519 Published specification: This document. 521 Applications that use this media type: 522 Systems that want to exchange full DNS messages. 524 Additional information: 526 Magic number(s): n/a 528 File extension(s): n/a 530 Macintosh file type code(s): n/a 532 Person & email address to contact for further information: 533 Paul Hoffman, paul.hoffman@icann.org 535 Intended usage: COMMON 537 Restrictions on usage: n/a 539 Author: Paul Hoffman, paul.hoffman@icann.org 541 Change controller: IESG 543 9. Privacy Considerations 545 [RFC7626] discusses DNS privacy considerations in both "On the wire" 546 (Section 2.4), and "In the server" (Section 2.5) contexts. This is 547 also a useful framing for DoH's privacy considerations. 549 9.1. On The Wire 551 DoH encrypts DNS traffic and requires authentication of the server. 552 This mitigates both passive surveillance [RFC7258] and active attacks 553 that attempt to divert DNS traffic to rogue servers ([RFC7626] 554 Section 2.5.1). DNS over TLS [RFC7858] provides similar protections, 555 while direct UDP and TCP based transports are vulnerable to this 556 class of attack. 558 Additionally, the use of the HTTPS default port 443 and the ability 559 to mix DoH traffic with other HTTPS traffic on the same connection 560 can deter unprivileged on-path devices from interfering with DNS 561 operations and make DNS traffic analysis more difficult. 563 9.2. In The Server 565 The DNS wire format [RFC1035] contains no client identifiers; 566 however, various transports of DNS queries and responses do provide 567 data that can be used to correlate requests. HTTPS presents new 568 considerations for correlation, such as explicit HTTP cookies and 569 implicit fingerprinting of the unique set and ordering of HTTP 570 request header fields. 572 A DoH implementation is built on IP, TCP, TLS, and HTTP. Each layer 573 contains one or more common features that can be used to correlate 574 queries to the same identity. DNS transports will generally carry 575 the same privacy properties of the layers used to implement them. 576 For example, the properties of IP, TCP, and TLS apply to DNS over TLS 577 implementations. 579 The privacy considerations of using the HTTPS layer in DoH are 580 incremental to those of DNS over TLS. DoH is not known to introduce 581 new concerns beyond those associated with HTTPS. 583 At the IP level, the client address provides obvious correlation 584 information. This can be mitigated by use of a NAT, proxy, VPN, or 585 simple address rotation over time. It may be aggravated by use of a 586 DNS server that can correlate real-time addressing information with 587 other personal identifiers, such as when a DNS server and DHCP server 588 are operated by the same entity. 590 DNS implementations that use one TCP connection for multiple DNS 591 requests directly group those requests. Long-lived connections have 592 better performance behaviors than short-lived connections, but group 593 more requests. TCP-based solutions may also seek performance through 594 the use of TCP Fast Open [RFC7413]. The cookies used in TCP Fast 595 Open allow servers to correlate TCP sessions. 597 TLS-based implementations often achieve better handshake performance 598 through the use of some form of session resumption mechanism such as 599 session tickets [RFC5077]. Session resumption creates trivial 600 mechanisms for a server to correlate TLS connections together. 602 HTTP's feature set can also be used for identification and tracking 603 in a number of different ways. For example, authentication request 604 header fields explicitly identify profiles in use, and HTTP Cookies 605 are designed as an explicit state-tracking mechanism between the 606 client and serving site and often are used as an authentication 607 mechanism. 609 Additionally, the User-Agent and Accept-Language request header 610 fields often convey specific information about the client version or 611 locale. This facilitates content negotiation and operational work- 612 arounds for implementation bugs. Request header fields that control 613 caching can expose state information about a subset of the client's 614 history. Mixing DoH requests with other HTTP requests on the same 615 connection also provides an opportunity for richer data correlation. 617 The DoH protocol design allows applications to fully leverage the 618 HTTP ecosystem, including features that are not enumerated here. 619 Utilizing the full set of HTTP features enables DoH to be more than 620 an HTTP tunnel, but at the cost of opening up implementations to the 621 full set of privacy considerations of HTTP. 623 Implementations of DoH clients and servers need to consider the 624 benefit and privacy impact of these features, and their deployment 625 context, when deciding whether or not to enable them. 626 Implementations are advised to expose the minimal set of data needed 627 to achieve the desired feature set. 629 Determining whether or not a DoH implementation requires HTTP cookie 630 [RFC6265] support is particularly important because HTTP cookies are 631 the primary state tracking mechanism in HTTP. HTTP Cookies SHOULD 632 NOT be accepted by DOH clients unless they are explicitly required by 633 a use case. 635 10. Security Considerations 637 Running DNS over HTTPS relies on the security of the underlying HTTP 638 transport. This mitigates classic amplification attacks for UDP- 639 based DNS. Implementations utilizing HTTP/2 benefit from the TLS 640 profile defined in [RFC7540] Section 9.2. 642 Session-level encryption has well-known weaknesses with respect to 643 traffic analysis which might be particularly acute when dealing with 644 DNS queries. HTTP/2 provides further advice about the use of 645 compression ([RFC7540] Section 10.6) and padding ([RFC7540] 646 Section 10.7 ). DoH Servers can also add DNS padding [RFC7830] if 647 the DoH client requests it in the DNS query. An experimental effort 648 to offer guidance on choosing the padding length can be found in 649 [I-D.ietf-dprive-padding-policy]. 651 The HTTPS connection provides transport security for the interaction 652 between the DoH server and client, but does not provide the response 653 integrity of DNS data provided by DNSSEC. DNSSEC and DoH are 654 independent and fully compatible protocols, each solving different 655 problems. The use of one does not diminish the need nor the 656 usefulness of the other. It is the choice of a client to either 657 perform full DNSSEC validation of answers or to trust the DoH server 658 to do DNSSEC validation and inspect the AD (Authentic Data) bit in 659 the returned message to determine whether an answer was authentic or 660 not. As noted in Section 5.2, different response media types will 661 provide more or less information from a DNS response so this choice 662 may be affected by the response media type. 664 Section 6.1 describes the interaction of this protocol with HTTP 665 caching. An adversary that can control the cache used by the client 666 can affect that client's view of the DNS. This is no different than 667 the security implications of HTTP caching for other protocols that 668 use HTTP. 670 In the absence of DNSSEC information, a DoH server can give a client 671 invalid data in response to a DNS query. Section 4 disallows the use 672 of DoH DNS responses that do not originate from configured servers. 673 This prohibition does not guarantee protection against invalid data, 674 but it does reduce the risk. 676 11. Operational Considerations 678 Local policy considerations and similar factors mean different DNS 679 servers may provide different results to the same query, for instance 680 in split DNS configurations [RFC6950]. It logically follows that the 681 server that is queried can influence the end result. Therefore a 682 client's choice of DNS server may affect the responses it gets to its 683 queries. For example, in the case of DNS64 [RFC6147], the choice 684 could affect whether IPv6/IPv4 translation will work at all. 686 The HTTPS channel used by this specification establishes secure two- 687 party communication between the DoH client and the DoH server. 688 Filtering or inspection systems that rely on unsecured transport of 689 DNS will not function in a DNS over HTTPS environment. 691 Some HTTPS client implementations perform real time third-party 692 checks of the revocation status of the certificates being used by 693 TLS. If this check is done as part of the DoH server connection 694 procedure and the check itself requires DNS resolution to connect to 695 the third party a deadlock can occur. The use of OCSP [RFC6960] 696 servers or AIA for CRL fetching ([RFC5280] Section 4.2.2.1) are 697 examples of how this deadlock can happen. To mitigate the 698 possibility of deadlock, DoH servers SHOULD NOT rely on DNS-based 699 references to external resources in the TLS handshake. For OCSP, the 700 server can bundle the certificate status as part of the handshake 701 using a mechanism appropriate to the version of TLS, such as using 702 [RFC6066] Section 8 for TLS version 1.2. AIA deadlocks can be 703 avoided by providing intermediate certificates that might otherwise 704 be obtained through additional requests. Note that these deadlocks 705 also need to be considered for server that a DoH server might 706 redirect to. 708 A DoH client may face a similar bootstrapping problem when the HTTP 709 request needs to resolve the hostname portion of the DNS URI. Just 710 as the address of a traditional DNS nameserver cannot be originally 711 determined from that same server, a DoH client cannot use its DoH 712 server to initially resolve the server's host name into an address. 713 Alternative strategies a client might employ include making the 714 initial resolution part of the configuration, IP-based URIs and 715 corresponding IP-based certificates for HTTPS, or resolving the DNS 716 API server's hostname via traditional DNS or another DoH server while 717 still authenticating the resulting connection via HTTPS. 719 HTTP [RFC7230] is a stateless application-level protocol and 720 therefore DoH implementations do not provide stateful ordering 721 guarantees between different requests. DoH cannot be used as a 722 transport for other protocols that require strict ordering. 724 A DoH server is allowed to answer queries with any valid DNS 725 response. For example, a valid DNS response might have the TC 726 (truncation) bit set in the DNS header to indicate that the server 727 was not able to retrieve a full answer for the query but is providing 728 the best answer it could get. A DoH server can reply to queries with 729 an HTTP error for queries that it cannot fulfill. In this same 730 example, a DoH server could use an HTTP error instead of a non-error 731 response that has the TC bit set. 733 Many extensions to DNS, using [RFC6891], have been defined over the 734 years. Extensions that are specific to the choice of transport, such 735 as [RFC7828], are not applicable to DoH. 737 12. References 739 12.1. Normative References 741 [RFC1035] Mockapetris, P., "Domain names - implementation and 742 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 743 November 1987, . 745 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 746 Requirement Levels", BCP 14, RFC 2119, 747 DOI 10.17487/RFC2119, March 1997, 748 . 750 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 751 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 752 . 754 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 755 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 756 . 758 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 759 (TLS) Protocol Version 1.2", RFC 5246, 760 DOI 10.17487/RFC5246, August 2008, 761 . 763 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 764 DOI 10.17487/RFC6265, April 2011, 765 . 767 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 768 and D. Orchard, "URI Template", RFC 6570, 769 DOI 10.17487/RFC6570, March 2012, 770 . 772 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 773 Protocol (HTTP/1.1): Message Syntax and Routing", 774 RFC 7230, DOI 10.17487/RFC7230, June 2014, 775 . 777 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 778 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 779 DOI 10.17487/RFC7231, June 2014, 780 . 782 [RFC7232] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 783 Protocol (HTTP/1.1): Conditional Requests", RFC 7232, 784 DOI 10.17487/RFC7232, June 2014, 785 . 787 [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, 788 Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", 789 RFC 7234, DOI 10.17487/RFC7234, June 2014, 790 . 792 [RFC7235] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 793 Protocol (HTTP/1.1): Authentication", RFC 7235, 794 DOI 10.17487/RFC7235, June 2014, 795 . 797 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 798 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 799 DOI 10.17487/RFC7540, May 2015, 800 . 802 [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for 803 HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, 804 . 806 [RFC7626] Bortzmeyer, S., "DNS Privacy Considerations", RFC 7626, 807 DOI 10.17487/RFC7626, August 2015, 808 . 810 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 811 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 812 May 2017, . 814 12.2. Informative References 816 [CORS] "Cross-Origin Resource Sharing", n.d., 817 . 819 [I-D.ietf-dprive-padding-policy] 820 Mayrhofer, A., "Padding Policy for EDNS(0)", draft-ietf- 821 dprive-padding-policy-06 (work in progress), July 2018. 823 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 824 DOI 10.17487/RFC2818, May 2000, 825 . 827 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 828 "Transport Layer Security (TLS) Session Resumption without 829 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 830 January 2008, . 832 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 833 Housley, R., and W. Polk, "Internet X.509 Public Key 834 Infrastructure Certificate and Certificate Revocation List 835 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 836 . 838 [RFC5861] Nottingham, M., "HTTP Cache-Control Extensions for Stale 839 Content", RFC 5861, DOI 10.17487/RFC5861, May 2010, 840 . 842 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 843 Extensions: Extension Definitions", RFC 6066, 844 DOI 10.17487/RFC6066, January 2011, 845 . 847 [RFC6147] Bagnulo, M., Sullivan, A., Matthews, P., and I. van 848 Beijnum, "DNS64: DNS Extensions for Network Address 849 Translation from IPv6 Clients to IPv4 Servers", RFC 6147, 850 DOI 10.17487/RFC6147, April 2011, 851 . 853 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 854 for DNS (EDNS(0))", STD 75, RFC 6891, 855 DOI 10.17487/RFC6891, April 2013, 856 . 858 [RFC6950] Peterson, J., Kolkman, O., Tschofenig, H., and B. Aboba, 859 "Architectural Considerations on Application Features in 860 the DNS", RFC 6950, DOI 10.17487/RFC6950, October 2013, 861 . 863 [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., 864 Galperin, S., and C. Adams, "X.509 Internet Public Key 865 Infrastructure Online Certificate Status Protocol - OCSP", 866 RFC 6960, DOI 10.17487/RFC6960, June 2013, 867 . 869 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 870 Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 871 2014, . 873 [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP 874 Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, 875 . 877 [RFC7828] Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The 878 edns-tcp-keepalive EDNS0 Option", RFC 7828, 879 DOI 10.17487/RFC7828, April 2016, 880 . 882 [RFC7830] Mayrhofer, A., "The EDNS(0) Padding Option", RFC 7830, 883 DOI 10.17487/RFC7830, May 2016, 884 . 886 [RFC7858] Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., 887 and P. Hoffman, "Specification for DNS over Transport 888 Layer Security (TLS)", RFC 7858, DOI 10.17487/RFC7858, May 889 2016, . 891 Acknowledgments 893 This work required a high level of cooperation between experts in 894 different technologies. Thank you Ray Bellis, Stephane Bortzmeyer, 895 Manu Bretelle, Sara Dickinson, Massimiliano Fantuzzi, Tony Finch, 896 Daniel Kahn Gilmor, Olafur Gudmundsson, Wes Hardaker, Rory Hewitt, 897 Joe Hildebrand, David Lawrence, Eliot Lear, John Mattsson, Alex 898 Mayrhofer, Mark Nottingham, Jim Reid, Adam Roach, Ben Schwartz, Davey 899 Song, Daniel Stenberg, Andrew Sullivan, Martin Thomson, and Sam 900 Weiler. 902 Previous Work on DNS over HTTP or in Other Formats 904 The following is an incomplete list of earlier work that related to 905 DNS over HTTP/1 or representing DNS data in other formats. 907 The list includes links to the tools.ietf.org site (because these 908 documents are all expired) and web sites of software. 910 o https://tools.ietf.org/html/draft-mohan-dns-query-xml 912 o https://tools.ietf.org/html/draft-daley-dnsxml 914 o https://tools.ietf.org/html/draft-dulaunoy-dnsop-passive-dns-cof 916 o https://tools.ietf.org/html/draft-bortzmeyer-dns-json 917 o https://www.nlnetlabs.nl/projects/dnssec-trigger/ 919 Authors' Addresses 921 Paul Hoffman 922 ICANN 924 Email: paul.hoffman@icann.org 926 Patrick McManus 927 Mozilla 929 Email: mcmanus@ducksong.com