idnits 2.17.1 draft-ietf-doh-dns-over-https-11.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 15, 2018) is 2141 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 informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) Summary: 7 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: December 17, 2018 Mozilla 6 June 15, 2018 8 DNS Queries over HTTPS (DoH) 9 draft-ietf-doh-dns-over-https-11 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 17, 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. Security Considerations . . . . . . . . . . . . . . . . . . . 13 69 10. Operational Considerations . . . . . . . . . . . . . . . . . 13 70 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 71 11.1. Normative References . . . . . . . . . . . . . . . . . . 15 72 11.2. Informative References . . . . . . . . . . . . . . . . . 16 73 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 17 74 Previous Work on DNS over HTTP or in Other Formats . . . . . . . 18 75 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 77 1. Introduction 79 This document defines a specific protocol for sending DNS [RFC1035] 80 queries and getting DNS responses over HTTP [RFC7540] using https 81 URIs (and therefore TLS [RFC5246] security for integrity and 82 confidentiality). Each DNS query-response pair is mapped into a HTTP 83 exchange. 85 The described approach is more than a tunnel over HTTP. It 86 establishes default media formatting types for requests and responses 87 but uses normal HTTP content negotiation mechanisms for selecting 88 alternatives that endpoints may prefer in anticipation of serving new 89 use cases. In addition to this media type negotiation, it aligns 90 itself with HTTP features such as caching, redirection, proxying, 91 authentication, and compression. 93 The integration with HTTP provides a transport suitable for both 94 existing DNS clients and native web applications seeking access to 95 the DNS. 97 Two primary uses cases were considered during this protocol's 98 development. They included preventing on-path devices from 99 interfering with DNS operations and allowing web applications to 100 access DNS information via existing browser APIs in a safe way 101 consistent with Cross Origin Resource Sharing (CORS) [CORS]. No 102 special effort has been taken to enable or prevent application to 103 other use cases. This document focuses on communication between DNS 104 clients (such as operating system stub resolvers) and recursive 105 resolvers. 107 2. Terminology 109 A server that supports this protocol is called a "DoH server" to 110 differentiate it from a "DNS server" (one that only provides DNS 111 service over one or more of the other transport protocols 112 standardized for DNS). Similarly, a client that supports this 113 protocol is called a "DoH client". 115 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 116 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 117 "OPTIONAL" in this document are to be interpreted as described in BCP 118 14 [RFC2119] [RFC8174] when, and only when, they appear in all 119 capitals, as shown here. 121 3. Protocol Requirements 123 [[ RFC Editor: Please remove this entire section before publication. 124 ]] 126 The protocol described here bases its design on the following 127 protocol requirements: 129 o The protocol must use normal HTTP semantics. 131 o The queries and responses must be able to be flexible enough to 132 express every DNS query that would normally be sent in DNS over 133 UDP (including queries and responses that use DNS extensions, but 134 not those that require multiple responses). 136 o The protocol must permit the addition of new formats for DNS 137 queries and responses. 139 o The protocol must ensure interoperability by specifying a single 140 format for requests and responses that is mandatory to implement. 142 That format must be able to support future modifications to the 143 DNS protocol including the inclusion of one or more EDNS options 144 (including those not yet defined). 146 o The protocol must use a secure transport that meets the 147 requirements for HTTPS. 149 3.1. Non-requirements 151 o Supporting network-specific DNS64 [RFC6147] 153 o Supporting other network-specific inferences from plaintext DNS 154 queries 156 o Supporting insecure HTTP 158 4. Selection of DoH Server 160 Configuration, discovery, and updating of the URI Template [RFC6570] 161 (see Section 5.1) is done out of band from this protocol. Note that 162 configuration might be manual (such as a user typing URI Templates in 163 a user interface for "options") or automatic (such as URI Templates 164 being supplied in responses from DHCP or similar protocols). DoH 165 Servers MAY support more than one URI. This allows the different 166 endpoints to have different properties such as different 167 authentication requirements or service level guarantees. 169 A DoH client uses configuration to select the URI, and thus the DoH 170 server, that is to be used for resolution. [RFC2818] defines how 171 HTTPS verifies the DoH server's identity. 173 A DoH client MUST NOT use a different URI simply because it was 174 discovered outside of the client's configuration, or because a server 175 offers an unsolicited response that appears to be a valid answer to a 176 DNS query. This specification does not extend DNS resolution 177 privileges to URIs that are not recognized by the DoH client as 178 configured URIs. Such scenarios may create additional operational, 179 tracking, and security hazards that require limitations for safe 180 usage. A future specification may support this use case. 182 5. The HTTP Exchange 184 5.1. The HTTP Request 186 A DoH client encodes a single DNS query into an HTTP request using 187 either the HTTP GET or POST method and the other requirements of this 188 section. The DoH server defines the URI used by the request through 189 the use of a URI Template. 191 The URI Template defined in this document is processed without any 192 variables when the HTTP method is POST. When the HTTP method is GET 193 the single variable "dns" is defined as the content of the DNS 194 request (as described in Section 7), encoded with base64url 195 [RFC4648]. 197 Future specifications for new media types MUST define the variables 198 used for URI Template processing with this protocol. 200 DoH servers MUST implement both the POST and GET methods. 202 When using the POST method the DNS query is included as the message 203 body of the HTTP request and the Content-Type request header 204 indicates the media type of the message. POST-ed requests are 205 smaller than their GET equivalents. 207 Using the GET method is friendlier to many HTTP cache 208 implementations. 210 The DoH client SHOULD include an HTTP "Accept" request header to 211 indicate what type of content can be understood in response. 212 Irrespective of the value of the Accept request header, the client 213 MUST be prepared to process "application/dns-message" (as described 214 in Section 7) responses but MAY also process any other type it 215 receives. 217 In order to maximize cache friendliness, DoH clients using media 218 formats that include DNS ID, such as application/dns-message, SHOULD 219 use a DNS ID of 0 in every DNS request. HTTP correlates the request 220 and response, thus eliminating the need for the ID in a media type 221 such as application/dns-message. The use of a varying DNS ID can 222 cause semantically equivalent DNS queries to be cached separately. 224 DoH clients can use HTTP/2 padding and compression in the same way 225 that other HTTP/2 clients use (or don't use) them. 227 5.1.1. HTTP Request Examples 229 These examples use HTTP/2 style formatting from [RFC7540]. 231 These examples use a DoH service with a URI Template of 232 "https://dnsserver.example.net/dns-query{?dns}" to resolve IN A 233 records. 235 The requests are represented as application/dns-message typed bodies. 237 The first example request uses GET to request www.example.com 238 :method = GET 239 :scheme = https 240 :authority = dnsserver.example.net 241 :path = /dns-query?dns=AAABAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB 242 accept = application/dns-message 244 The same DNS query for www.example.com, using the POST method would 245 be: 247 :method = POST 248 :scheme = https 249 :authority = dnsserver.example.net 250 :path = /dns-query 251 accept = application/dns-message 252 content-type = application/dns-message 253 content-length = 33 255 <33 bytes represented by the following hex encoding> 256 00 00 01 00 00 01 00 00 00 00 00 00 03 77 77 77 257 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 258 01 260 Finally, a GET based query for a.62characterlabel-makes-base64url- 261 distinct-from-standard-base64.example.com is shown as an example to 262 emphasize that the encoding alphabet of base64url is different than 263 regular base64 and that padding is omitted. 265 The DNS query is 94 bytes represented by the following hex encoding 267 00 00 01 00 00 01 00 00 00 00 00 00 01 61 3e 36 268 32 63 68 61 72 61 63 74 65 72 6c 61 62 65 6c 2d 269 6d 61 6b 65 73 2d 62 61 73 65 36 34 75 72 6c 2d 270 64 69 73 74 69 6e 63 74 2d 66 72 6f 6d 2d 73 74 271 61 6e 64 61 72 64 2d 62 61 73 65 36 34 07 65 78 272 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 274 :method = GET 275 :scheme = https 276 :authority = dnsserver.example.net 277 :path = /dns-query? (no space or CR) 278 dns=AAABAAABAAAAAAAAAWE-NjJjaGFyYWN0ZXJsYWJl (no space or CR) 279 bC1tYWtlcy1iYXNlNjR1cmwtZGlzdGluY3QtZnJvbS1z (no space or CR) 280 dGFuZGFyZC1iYXNlNjQHZXhhbXBsZQNjb20AAAEAAQ 281 accept = application/dns-message 283 5.2. The HTTP Response 285 The only response type defined in this document is "application/dns- 286 message", but it is possible that other response formats will be 287 defined in the future. A DoH server MUST be able to process 288 application/dns-message request messages. 290 Different response media types will provide more or less information 291 from a DNS response. For example, one response type might include 292 information from the DNS header bytes while another might omit it. 293 The amount and type of information that a media type gives is solely 294 up to the format, and not defined in this protocol. 296 Each DNS request-response pair is matched to one HTTP exchange. The 297 responses may be processed and transported in any order using HTTP's 298 multi-streaming functionality ([RFC7540] Section 5). 300 Section 6.1 discusses the relationship between DNS and HTTP response 301 caching. 303 5.2.1. Handling DNS and HTTP Errors 305 DNS response codes indicate either success or failure for the DNS 306 query. A successful HTTP response with a 2xx status code ([RFC7231] 307 Section 6.3) can be used for any valid DNS response, regardless of 308 the DNS response code. For example, a successful 2xx HTTP status 309 code is used even with a DNS message whose DNS response code 310 indicates failure, such as SERVFAIL or NXDOMAIN. 312 HTTP responses with non-successful HTTP status codes do not contain 313 replies to the original DNS question in the HTTP request. DoH 314 clients need to use the same semantic processing of non-successful 315 HTTP status codes as other HTTP clients. This might mean that the 316 DoH client retries the query with the same DoH server, such as 317 authorization failures (HTTP status code 401 [RFC7235] Section 3.1). 318 It could also mean that the DoH client retries with a different DoH 319 server, such as for unsupported media types (HTTP status code 415, 320 [RFC7231] Section 6.5.13), or where the server cannot generate a 321 representation suitable for the client (HTTP status code 406, 322 [RFC7231] Section 6.5.6), and so on. 324 5.2.2. HTTP Response Example 326 This is an example response for a query for the IN A records for 327 "www.example.com" with recursion turned on. The response bears one 328 record with an address of 192.0.2.1 and a TTL of 128 seconds. 330 :status = 200 331 content-type = application/dns-message 332 content-length = 64 333 cache-control = max-age=128 335 <64 bytes represented by the following hex encoding> 336 00 00 81 80 00 01 00 01 00 00 00 00 03 77 77 77 337 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 338 01 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 339 6d 00 00 01 00 01 00 00 00 80 00 04 C0 00 02 01 341 6. HTTP Integration 343 This protocol MUST be used with the https scheme URI [RFC7230]. 345 6.1. Cache Interaction 347 A DoH exchange can pass through a hierarchy of caches that include 348 both HTTP and DNS specific caches. These caches may exist beteen the 349 DoH server and client, or on the DoH client itself. HTTP caches are 350 by design generic; that is, they do not understand this protocol. 351 Even if a DoH client has modified its cache implementation to be 352 aware of DoH semantics, it does not follow that all upstream caches 353 (for example, inline proxies, server-side gateways and Content 354 Delivery Networks) will be. 356 As a result, DoH servers need to carefully consider the HTTP caching 357 metadata they send in response to GET requests (POST requests are not 358 cacheable unless specific response headers are sent; this is not 359 widely implemented, and not advised for DoH). 361 In particular, DoH servers SHOULD assign an explicit freshness 362 lifetime ([RFC7234] Section 4.2) so that the DoH client is more 363 likely to use fresh DNS data. This requirement is due to HTTP caches 364 being able to assign their own heuristic freshness (such as that 365 described in [RFC7234] Section 4.2.2), which would take control of 366 the cache contents out of the hands of the DoH server. 368 The assigned freshness lifetime of a DoH HTTP response SHOULD be the 369 smallest TTL in the Answer section of the DNS response. For example, 370 if a HTTP response carries three RRsets with TTLs of 30, 600, and 371 300, the HTTP freshness lifetime should be 30 seconds (which could be 372 specified as "Cache-Control: max-age=30"). The assigned freshness 373 lifetime MUST NOT be greater than the smallest TTL in the Answer 374 section of the DNS response. This requirement helps assure that none 375 of the RRsets contained in a DNS response are served stale from an 376 HTTP cache. 378 If the DNS response has no records in the Answer section, and the DNS 379 response has an SOA record in the Authority section, the response 380 freshness lifetime MUST NOT be greater than the MINIMUM field from 381 that SOA record (see [RFC2308]). 383 The stale-while-revalidate and stale-if-error Cache-Control 384 directives ([RFC5861]) could be well suited to a DoH implementation 385 when allowed by server policy. Those mechanisms allow a client, at 386 the server's discretion, to reuse a cache entry that is no longer 387 fresh. In such a case, the client reuses all of a cached entry, or 388 none of it. 390 DoH servers also need to consider caching when generating responses 391 that are not globally valid. For instance, if a DoH server 392 customizes a response based on the client's identity, it would not 393 want to allow global reuse of that response. This could be 394 accomplished through a variety of HTTP techniques such as a Cache- 395 Control max-age of 0, or by using the Vary response header ([RFC7231] 396 Section 7.1.4) to establish a secondary cache key ([RFC7234] 397 Section 4.1). 399 DoH clients MUST account for the Age response header's value 400 ([RFC7234]) when calculating the DNS TTL of a response. For example, 401 if a RRset is received with a DNS TTL of 600, but the Age header 402 indicates that the response has been cached for 250 seconds, the 403 remaining lifetime of the RRset is 350 seconds. 405 DoH clients can request an uncached copy of a response by using the 406 "no-cache" request cache control directive ([RFC7234], 407 Section 5.2.1.4) and similar controls. Note that some caches might 408 not honor these directives, either due to configuration or 409 interaction with traditional DNS caches that do not have such a 410 mechanism. 412 HTTP conditional requests ([RFC7232]) may be of limited value to DoH, 413 as revalidation provides only a bandwidth benefit and DNS 414 transactions are normally latency bound. Furthermore, the HTTP 415 response headers that enable revalidation (such as "Last-Modified" 416 and "Etag") are often fairly large when compared to the overall DNS 417 response size, and have a variable nature that creates constant 418 pressure on the HTTP/2 compression dictionary [RFC7541]. Other types 419 of DNS data, such as zone transfers, may be larger and benefit more 420 from revalidation. 422 6.2. HTTP/2 424 HTTP/2 [RFC7540] is the minimum RECOMMENDED version of HTTP for use 425 with DoH. 427 The messages in classic UDP based DNS [RFC1035] are inherently 428 unordered and have low overhead. A competitive HTTP transport needs 429 to support reordering, parallelism, priority, and header compression 430 to achieve similar performance. Those features were introduced to 431 HTTP in HTTP/2 [RFC7540]. Earlier versions of HTTP are capable of 432 conveying the semantic requirements of DoH but may result in very 433 poor performance. 435 6.3. Server Push 437 Before using DoH response data for DNS resolution, the client MUST 438 establish that the HTTP request URI may be used for the DoH query. 439 For HTTP requests initiated by the DoH client this is implicit in the 440 selection of URI. For HTTP server push ([RFC7540] Section 8.2) extra 441 care must be taken to ensure that the pushed URI is one that the 442 client would have directed the same query to if the client had 443 initiated the request. 445 6.4. Content Negotiation 447 In order to maximize interoperability, DoH clients and DoH servers 448 MUST support the "application/dns-message" media type. Other media 449 types MAY be used as defined by HTTP Content Negotiation ([RFC7231] 450 Section 3.4). Those media types MUST be flexible enough to express 451 every DNS query that would normally be sent in DNS over UDP 452 (including queries and responses that use DNS extensions, but not 453 those that require multiple responses). 455 7. Definition of the application/dns-message media type 457 The data payload for the application/dns-message media type is a 458 single message of the DNS on-the-wire format defined in section 4.2.1 459 of [RFC1035]. The format was originally for DNS over UDP. Although 460 [RFC1035] says "Messages carried by UDP are restricted to 512 bytes", 461 that was later updated by [RFC6891]. This media type restricts the 462 maximum size of the DNS message to 65535 bytes. Note that the wire 463 format used in this media type is different than the wire format used 464 in [RFC7858] (which uses the format defined in section 4.2.2 of 465 [RFC1035]). 467 DoH clients using this media type MAY have one or more EDNS options 468 [RFC6891] in the request. DoH servers using this media type MUST 469 ignore the value given for the EDNS UDP payload size in DNS requests. 471 When using the GET method, the data payload for this media type MUST 472 be encoded with base64url [RFC4648] and then provided as a variable 473 named "dns" to the URI Template expansion. Padding characters for 474 base64url MUST NOT be included. 476 When using the POST method, the data payload for this media type MUST 477 NOT be encoded and is used directly as the HTTP message body. 479 8. IANA Considerations 481 8.1. Registration of application/dns-message Media Type 482 To: ietf-types@iana.org 483 Subject: Registration of MIME media type 484 application/dns-message 486 MIME media type name: application 488 MIME subtype name: dns-message 490 Required parameters: n/a 492 Optional parameters: n/a 494 Encoding considerations: This is a binary format. The contents are a 495 DNS message as defined in RFC 1035. The format used here is for DNS 496 over UDP, which is the format defined in the diagrams in RFC 1035. 498 Security considerations: The security considerations for carrying 499 this data are the same for carrying DNS without encryption. 501 Interoperability considerations: None. 503 Published specification: This document. 505 Applications that use this media type: 506 Systems that want to exchange full DNS messages. 508 Additional information: 510 Magic number(s): n/a 512 File extension(s): n/a 514 Macintosh file type code(s): n/a 516 Person & email address to contact for further information: 517 Paul Hoffman, paul.hoffman@icann.org 519 Intended usage: COMMON 521 Restrictions on usage: n/a 523 Author: Paul Hoffman, paul.hoffman@icann.org 525 Change controller: IESG 527 9. Security Considerations 529 Running DNS over HTTPS relies on the security of the underlying HTTP 530 transport. This mitigates classic amplification attacks for UDP- 531 based DNS. Implementations utilizing HTTP/2 benefit from the TLS 532 profile defined in [RFC7540] Section 9.2. 534 Session level encryption has well known weaknesses with respect to 535 traffic analysis which might be particularly acute when dealing with 536 DNS queries. HTTP/2 provides further advice about the use of 537 compression ([RFC7540] Section 10.6) and padding ([RFC7540] 538 Section 10.7 ). DoH Servers can also add DNS padding [RFC7830] if 539 the DoH requests it in the DNS query. 541 The HTTPS connection provides transport security for the interaction 542 between the DoH server and client, but does not provide the response 543 integrity of DNS data provided by DNSSEC. DNSSEC and DoH are 544 independent and fully compatible protocols, each solving different 545 problems. The use of one does not diminish the need nor the 546 usefulness of the other. It is the choice of a client to either 547 perform full DNSSEC validation of answers or to trust the DoH server 548 to do DNSSEC validation and inspect the AD (Authentic Data) bit in 549 the returned message to determine whether an answer was authentic or 550 not. As noted in Section 5.2, different response media types will 551 provide more or less information from a DNS response so this choice 552 may be affected by the response media type. 554 Section 6.1 describes the interaction of this protocol with HTTP 555 caching. An adversary that can control the cache used by the client 556 can affect that client's view of the DNS. This is no different than 557 the security implications of HTTP caching for other protocols that 558 use HTTP. 560 In the absence of DNSSEC information, a DoH server can give a client 561 invalid data in response to a DNS query. Section 4 disallows the use 562 of DoH DNS responses that do not originate from configured servers. 563 This prohibition does not guarantee protection against invalid data, 564 but it does reduce the risk. 566 10. Operational Considerations 568 Local policy considerations and similar factors mean different DNS 569 servers may provide different results to the same query: for instance 570 in split DNS configurations [RFC6950]. It logically follows that the 571 server which is queried can influence the end result. Therefore a 572 client's choice of DNS server may affect the responses it gets to its 573 queries. For example, in the case of DNS64 [RFC6147], the choice 574 could affect whether IPv6/IPv4 translation will work at all. 576 The HTTPS channel used by this specification establishes secure two 577 party communication between the DoH client and the DoH server. 578 Filtering or inspection systems that rely on unsecured transport of 579 DNS will not function in a DNS over HTTPS environment. 581 Some HTTPS client implementations perform real time third party 582 checks of the revocation status of the certificates being used by 583 TLS. If this check is done as part of the DoH server connection 584 procedure and the check itself requires DNS resolution to connect to 585 the third party a deadlock can occur. The use of OCSP [RFC6960] 586 servers or AIA for CRL fetching ([RFC5280] Section 4.2.2.1) are 587 examples of how this deadlock can happen. To mitigate the 588 possibility of deadlock, DoH servers SHOULD NOT rely on DNS based 589 references to external resources in the TLS handshake. For OCSP the 590 server can bundle the certificate status as part of the handshake 591 using a mechanism appropriate to the version of TLS, such as using 592 [RFC6066] Section 8 for TLS version 1.2. AIA deadlocks can be 593 avoided by providing intermediate certificates that might otherwise 594 be obtained through additional requests. Note that these deadlocks 595 also need to be considered for server that a DoH server might 596 redirect to. 598 A DoH client may face a similar bootstrapping problem when the HTTP 599 request needs to resolve the hostname portion of the DNS URI. Just 600 as the address of a traditional DNS nameserver cannot be originally 601 determined from that same server, a DoH client cannot use its DoH 602 server to initially resolve the server's host name into an address. 603 Alternative strategies a client might employ include making the 604 initial resolution part of the configuration, IP based URIs and 605 corresponding IP based certificates for HTTPS, or resolving the DNS 606 API server's hostname via traditional DNS or another DoH server while 607 still authenticating the resulting connection via HTTPS. 609 HTTP [RFC7230] is a stateless application level protocol and 610 therefore DoH implementations do not provide stateful ordering 611 guarantees between different requests. DoH cannot be used as a 612 transport for other protocols that require strict ordering. 614 A DoH server is allowed to answer queries with any valid DNS 615 response. For example, a valid DNS response might have the TC 616 (truncation) bit set in the DNS header to indicate that the server 617 was not able to retrieve a full answer for the query but is providing 618 the best answer it could get. A DoH server can reply to queries with 619 an HTTP error for queries that it cannot fulfill. In this same 620 example, a DoH server could use an HTTP error instead of a non-error 621 response that has the TC bit set. 623 Many extensions to DNS, using [RFC6891], have been defined over the 624 years. Extensions that are specific to the choice of transport, such 625 as [RFC7828], are not applicable to DoH. 627 11. References 629 11.1. Normative References 631 [RFC1035] Mockapetris, P., "Domain names - implementation and 632 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 633 November 1987, . 635 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 636 Requirement Levels", BCP 14, RFC 2119, 637 DOI 10.17487/RFC2119, March 1997, 638 . 640 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 641 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 642 . 644 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 645 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 646 . 648 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 649 (TLS) Protocol Version 1.2", RFC 5246, 650 DOI 10.17487/RFC5246, August 2008, 651 . 653 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 654 and D. Orchard, "URI Template", RFC 6570, 655 DOI 10.17487/RFC6570, March 2012, 656 . 658 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 659 Protocol (HTTP/1.1): Message Syntax and Routing", 660 RFC 7230, DOI 10.17487/RFC7230, June 2014, 661 . 663 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 664 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 665 DOI 10.17487/RFC7231, June 2014, 666 . 668 [RFC7232] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 669 Protocol (HTTP/1.1): Conditional Requests", RFC 7232, 670 DOI 10.17487/RFC7232, June 2014, 671 . 673 [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, 674 Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", 675 RFC 7234, DOI 10.17487/RFC7234, June 2014, 676 . 678 [RFC7235] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 679 Protocol (HTTP/1.1): Authentication", RFC 7235, 680 DOI 10.17487/RFC7235, June 2014, 681 . 683 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 684 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 685 DOI 10.17487/RFC7540, May 2015, 686 . 688 [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for 689 HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, 690 . 692 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 693 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 694 May 2017, . 696 11.2. Informative References 698 [CORS] "Cross-Origin Resource Sharing", n.d., 699 . 701 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 702 DOI 10.17487/RFC2818, May 2000, 703 . 705 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 706 Housley, R., and W. Polk, "Internet X.509 Public Key 707 Infrastructure Certificate and Certificate Revocation List 708 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 709 . 711 [RFC5861] Nottingham, M., "HTTP Cache-Control Extensions for Stale 712 Content", RFC 5861, DOI 10.17487/RFC5861, May 2010, 713 . 715 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 716 Extensions: Extension Definitions", RFC 6066, 717 DOI 10.17487/RFC6066, January 2011, 718 . 720 [RFC6147] Bagnulo, M., Sullivan, A., Matthews, P., and I. van 721 Beijnum, "DNS64: DNS Extensions for Network Address 722 Translation from IPv6 Clients to IPv4 Servers", RFC 6147, 723 DOI 10.17487/RFC6147, April 2011, 724 . 726 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 727 for DNS (EDNS(0))", STD 75, RFC 6891, 728 DOI 10.17487/RFC6891, April 2013, 729 . 731 [RFC6950] Peterson, J., Kolkman, O., Tschofenig, H., and B. Aboba, 732 "Architectural Considerations on Application Features in 733 the DNS", RFC 6950, DOI 10.17487/RFC6950, October 2013, 734 . 736 [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., 737 Galperin, S., and C. Adams, "X.509 Internet Public Key 738 Infrastructure Online Certificate Status Protocol - OCSP", 739 RFC 6960, DOI 10.17487/RFC6960, June 2013, 740 . 742 [RFC7828] Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The 743 edns-tcp-keepalive EDNS0 Option", RFC 7828, 744 DOI 10.17487/RFC7828, April 2016, 745 . 747 [RFC7830] Mayrhofer, A., "The EDNS(0) Padding Option", RFC 7830, 748 DOI 10.17487/RFC7830, May 2016, 749 . 751 [RFC7858] Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., 752 and P. Hoffman, "Specification for DNS over Transport 753 Layer Security (TLS)", RFC 7858, DOI 10.17487/RFC7858, May 754 2016, . 756 Acknowledgments 758 This work required a high level of cooperation between experts in 759 different technologies. Thank you Ray Bellis, Stephane Bortzmeyer, 760 Manu Bretelle, Sara Dickinson, Tony Finch, Daniel Kahn Gilmor, Olafur 761 Guomundsson, Wes Hardaker, Rory Hewitt, Joe Hildebrand, David 762 Lawrence, Eliot Lear, John Mattsson, Alex Mayrhofer, Mark Nottingham, 763 Jim Reid, Adam Roach, Ben Schwartz, Davey Song, Daniel Stenberg, 764 Andrew Sullivan, Martin Thomson, and Sam Weiler. 766 Previous Work on DNS over HTTP or in Other Formats 768 The following is an incomplete list of earlier work that related to 769 DNS over HTTP/1 or representing DNS data in other formats. 771 The list includes links to the tools.ietf.org site (because these 772 documents are all expired) and web sites of software. 774 o https://tools.ietf.org/html/draft-mohan-dns-query-xml 776 o https://tools.ietf.org/html/draft-daley-dnsxml 778 o https://tools.ietf.org/html/draft-dulaunoy-dnsop-passive-dns-cof 780 o https://tools.ietf.org/html/draft-bortzmeyer-dns-json 782 o https://www.nlnetlabs.nl/projects/dnssec-trigger/ 784 Authors' Addresses 786 Paul Hoffman 787 ICANN 789 Email: paul.hoffman@icann.org 791 Patrick McManus 792 Mozilla 794 Email: mcmanus@ducksong.com