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