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