| < draft-ietf-doh-dns-over-https-12.txt | draft-ietf-doh-dns-over-https-13.txt > | |||
|---|---|---|---|---|
| Network Working Group P. Hoffman | Network Working Group P. Hoffman | |||
| Internet-Draft ICANN | Internet-Draft ICANN | |||
| Intended status: Standards Track P. McManus | Intended status: Standards Track P. McManus | |||
| Expires: December 29, 2018 Mozilla | Expires: February 9, 2019 Mozilla | |||
| June 27, 2018 | August 08, 2018 | |||
| DNS Queries over HTTPS (DoH) | DNS Queries over HTTPS (DoH) | |||
| draft-ietf-doh-dns-over-https-12 | draft-ietf-doh-dns-over-https-13 | |||
| Abstract | Abstract | |||
| This document describes how to make DNS queries over HTTPS. | This document defines a protocol for sending DNS queries and getting | |||
| DNS responses over HTTPS. Each DNS query-response pair is mapped | ||||
| into an HTTP exchange. | ||||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on December 29, 2018. | This Internet-Draft will expire on February 9, 2019. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2018 IETF Trust and the persons identified as the | Copyright (c) 2018 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| skipping to change at page 2, line 36 ¶ | skipping to change at page 2, line 36 ¶ | |||
| 9. Privacy Considerations . . . . . . . . . . . . . . . . . . . 13 | 9. Privacy Considerations . . . . . . . . . . . . . . . . . . . 13 | |||
| 9.1. On The Wire . . . . . . . . . . . . . . . . . . . . . . . 13 | 9.1. On The Wire . . . . . . . . . . . . . . . . . . . . . . . 13 | |||
| 9.2. In The Server . . . . . . . . . . . . . . . . . . . . . . 13 | 9.2. In The Server . . . . . . . . . . . . . . . . . . . . . . 13 | |||
| 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 | 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 | |||
| 11. Operational Considerations . . . . . . . . . . . . . . . . . 15 | 11. Operational Considerations . . . . . . . . . . . . . . . . . 15 | |||
| 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 | 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 12.1. Normative References . . . . . . . . . . . . . . . . . . 17 | 12.1. Normative References . . . . . . . . . . . . . . . . . . 17 | |||
| 12.2. Informative References . . . . . . . . . . . . . . . . . 18 | 12.2. Informative References . . . . . . . . . . . . . . . . . 18 | |||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 20 | Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 20 | |||
| Previous Work on DNS over HTTP or in Other Formats . . . . . . . 20 | Previous Work on DNS over HTTP or in Other Formats . . . . . . . 20 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 20 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
| 1. Introduction | 1. Introduction | |||
| This document defines a specific protocol for sending DNS [RFC1035] | This document defines a specific protocol for sending DNS [RFC1035] | |||
| queries and getting DNS responses over HTTP [RFC7540] using https | queries and getting DNS responses over HTTP [RFC7540] using https | |||
| URIs (and therefore TLS [RFC5246] security for integrity and | URIs (and therefore TLS [RFC5246] security for integrity and | |||
| confidentiality). Each DNS query-response pair is mapped into a HTTP | confidentiality). Each DNS query-response pair is mapped into an | |||
| exchange. | HTTP exchange. | |||
| The described approach is more than a tunnel over HTTP. It | The described approach is more than a tunnel over HTTP. It | |||
| establishes default media formatting types for requests and responses | establishes default media formatting types for requests and responses | |||
| but uses normal HTTP content negotiation mechanisms for selecting | but uses normal HTTP content negotiation mechanisms for selecting | |||
| alternatives that endpoints may prefer in anticipation of serving new | alternatives that endpoints may prefer in anticipation of serving new | |||
| use cases. In addition to this media type negotiation, it aligns | use cases. In addition to this media type negotiation, it aligns | |||
| itself with HTTP features such as caching, redirection, proxying, | itself with HTTP features such as caching, redirection, proxying, | |||
| authentication, and compression. | authentication, and compression. | |||
| The integration with HTTP provides a transport suitable for both | The integration with HTTP provides a transport suitable for both | |||
| skipping to change at page 4, line 28 ¶ | skipping to change at page 4, line 28 ¶ | |||
| o Supporting insecure HTTP | o Supporting insecure HTTP | |||
| 4. Selection of DoH Server | 4. Selection of DoH Server | |||
| Configuration, discovery, and updating of the URI Template [RFC6570] | Configuration, discovery, and updating of the URI Template [RFC6570] | |||
| (see Section 5.1) is done out of band from this protocol. Note that | (see Section 5.1) is done out of band from this protocol. Note that | |||
| configuration might be manual (such as a user typing URI Templates in | configuration might be manual (such as a user typing URI Templates in | |||
| a user interface for "options") or automatic (such as URI Templates | a user interface for "options") or automatic (such as URI Templates | |||
| being supplied in responses from DHCP or similar protocols). DoH | being supplied in responses from DHCP or similar protocols). DoH | |||
| Servers MAY support more than one URI. This allows the different | Servers MAY support more than one URI Template. This allows the | |||
| endpoints to have different properties such as different | different endpoints to have different properties such as different | |||
| authentication requirements or service level guarantees. | authentication requirements or service level guarantees. | |||
| A DoH client uses configuration to select the URI, and thus the DoH | A DoH client uses configuration to select the URI, and thus the DoH | |||
| server, that is to be used for resolution. [RFC2818] defines how | server, that is to be used for resolution. [RFC2818] defines how | |||
| HTTPS verifies the DoH server's identity. | HTTPS verifies the DoH server's identity. | |||
| A DoH client MUST NOT use a different URI simply because it was | A DoH client MUST NOT use a different URI simply because it was | |||
| discovered outside of the client's configuration, or because a server | discovered outside of the client's configuration, or because a server | |||
| offers an unsolicited response that appears to be a valid answer to a | offers an unsolicited response that appears to be a valid answer to a | |||
| DNS query. This specification does not extend DNS resolution | DNS query. This specification does not extend DNS resolution | |||
| skipping to change at page 5, line 17 ¶ | skipping to change at page 5, line 17 ¶ | |||
| the single variable "dns" is defined as the content of the DNS | the single variable "dns" is defined as the content of the DNS | |||
| request (as described in Section 7), encoded with base64url | request (as described in Section 7), encoded with base64url | |||
| [RFC4648]. | [RFC4648]. | |||
| Future specifications for new media types MUST define the variables | Future specifications for new media types MUST define the variables | |||
| used for URI Template processing with this protocol. | used for URI Template processing with this protocol. | |||
| DoH servers MUST implement both the POST and GET methods. | DoH servers MUST implement both the POST and GET methods. | |||
| When using the POST method the DNS query is included as the message | When using the POST method the DNS query is included as the message | |||
| body of the HTTP request and the Content-Type request header | body of the HTTP request and the Content-Type request header field | |||
| indicates the media type of the message. POST-ed requests are | indicates the media type of the message. POST-ed requests are | |||
| smaller than their GET equivalents. | smaller than their GET equivalents. | |||
| Using the GET method is friendlier to many HTTP cache | Using the GET method is friendlier to many HTTP cache | |||
| implementations. | implementations. | |||
| The DoH client SHOULD include an HTTP "Accept" request header to | The DoH client SHOULD include an HTTP "Accept" request header field | |||
| indicate what type of content can be understood in response. | to indicate what type of content can be understood in response. | |||
| Irrespective of the value of the Accept request header, the client | Irrespective of the value of the Accept request header field, the | |||
| MUST be prepared to process "application/dns-message" (as described | client MUST be prepared to process "application/dns-message" (as | |||
| in Section 7) responses but MAY also process any other type it | described in Section 7) responses but MAY also process any other type | |||
| receives. | it receives. | |||
| In order to maximize cache friendliness, DoH clients using media | In order to maximize cache friendliness, DoH clients using media | |||
| formats that include DNS ID, such as application/dns-message, SHOULD | formats that include DNS ID, such as application/dns-message, SHOULD | |||
| use a DNS ID of 0 in every DNS request. HTTP correlates the request | use a DNS ID of 0 in every DNS request. HTTP correlates the request | |||
| and response, thus eliminating the need for the ID in a media type | and response, thus eliminating the need for the ID in a media type | |||
| such as application/dns-message. The use of a varying DNS ID can | such as application/dns-message. The use of a varying DNS ID can | |||
| cause semantically equivalent DNS queries to be cached separately. | cause semantically equivalent DNS queries to be cached separately. | |||
| DoH clients can use HTTP/2 padding and compression in the same way | DoH clients can use HTTP/2 padding and compression in the same way | |||
| that other HTTP/2 clients use (or don't use) them. | that other HTTP/2 clients use (or don't use) them. | |||
| skipping to change at page 6, line 26 ¶ | skipping to change at page 6, line 26 ¶ | |||
| :path = /dns-query | :path = /dns-query | |||
| accept = application/dns-message | accept = application/dns-message | |||
| content-type = application/dns-message | content-type = application/dns-message | |||
| content-length = 33 | content-length = 33 | |||
| <33 bytes represented by the following hex encoding> | <33 bytes represented by the following hex encoding> | |||
| 00 00 01 00 00 01 00 00 00 00 00 00 03 77 77 77 | 00 00 01 00 00 01 00 00 00 00 00 00 03 77 77 77 | |||
| 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 | 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 | |||
| 01 | 01 | |||
| In this example, the 33 bytes are the DNS message in DNS wire format. | ||||
| Finally, a GET based query for a.62characterlabel-makes-base64url- | Finally, a GET based query for a.62characterlabel-makes-base64url- | |||
| distinct-from-standard-base64.example.com is shown as an example to | distinct-from-standard-base64.example.com is shown as an example to | |||
| emphasize that the encoding alphabet of base64url is different than | emphasize that the encoding alphabet of base64url is different than | |||
| regular base64 and that padding is omitted. | regular base64 and that padding is omitted. | |||
| The DNS query is 94 bytes represented by the following hex encoding | The DNS query, expressed in DNS wire format, is 94 bytes represented | |||
| by the following: | ||||
| 00 00 01 00 00 01 00 00 00 00 00 00 01 61 3e 36 | 00 00 01 00 00 01 00 00 00 00 00 00 01 61 3e 36 | |||
| 32 63 68 61 72 61 63 74 65 72 6c 61 62 65 6c 2d | 32 63 68 61 72 61 63 74 65 72 6c 61 62 65 6c 2d | |||
| 6d 61 6b 65 73 2d 62 61 73 65 36 34 75 72 6c 2d | 6d 61 6b 65 73 2d 62 61 73 65 36 34 75 72 6c 2d | |||
| 64 69 73 74 69 6e 63 74 2d 66 72 6f 6d 2d 73 74 | 64 69 73 74 69 6e 63 74 2d 66 72 6f 6d 2d 73 74 | |||
| 61 6e 64 61 72 64 2d 62 61 73 65 36 34 07 65 78 | 61 6e 64 61 72 64 2d 62 61 73 65 36 34 07 65 78 | |||
| 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 | 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 | |||
| :method = GET | :method = GET | |||
| :scheme = https | :scheme = https | |||
| skipping to change at page 7, line 48 ¶ | skipping to change at page 7, line 48 ¶ | |||
| DoH client retries the query with the same DoH server, such as | DoH client retries the query with the same DoH server, such as | |||
| authorization failures (HTTP status code 401 [RFC7235] Section 3.1). | authorization failures (HTTP status code 401 [RFC7235] Section 3.1). | |||
| It could also mean that the DoH client retries with a different DoH | It could also mean that the DoH client retries with a different DoH | |||
| server, such as for unsupported media types (HTTP status code 415, | server, such as for unsupported media types (HTTP status code 415, | |||
| [RFC7231] Section 6.5.13), or where the server cannot generate a | [RFC7231] Section 6.5.13), or where the server cannot generate a | |||
| representation suitable for the client (HTTP status code 406, | representation suitable for the client (HTTP status code 406, | |||
| [RFC7231] Section 6.5.6), and so on. | [RFC7231] Section 6.5.6), and so on. | |||
| 5.2.2. HTTP Response Example | 5.2.2. HTTP Response Example | |||
| This is an example response for a query for the IN A records for | This is an example response for a query for the IN AAAA records for | |||
| "www.example.com" with recursion turned on. The response bears one | "www.example.com" with recursion turned on. The response bears one | |||
| record with an address of 192.0.2.1 and a TTL of 128 seconds. | answer record with an address of 2001:db8:abcd:12:1:2:3:4 and a TTL | |||
| of 3709 seconds. | ||||
| :status = 200 | :status = 200 | |||
| content-type = application/dns-message | content-type = application/dns-message | |||
| content-length = 64 | content-length = 61 | |||
| cache-control = max-age=128 | cache-control = max-age=3709 | |||
| <64 bytes represented by the following hex encoding> | <61 bytes represented by the following hex encoding> | |||
| 00 00 81 80 00 01 00 01 00 00 00 00 03 77 77 77 | 00 00 81 80 00 01 00 01 00 00 00 00 03 77 77 77 | |||
| 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 | 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 1c 00 | |||
| 01 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f | 01 c0 0c 00 1c 00 01 00 00 0e 7d 00 10 20 01 0d | |||
| 6d 00 00 01 00 01 00 00 00 80 00 04 C0 00 02 01 | b8 ab cd 00 12 00 01 00 02 00 03 00 04 | |||
| 6. HTTP Integration | 6. HTTP Integration | |||
| This protocol MUST be used with the https scheme URI [RFC7230]. | This protocol MUST be used with the https scheme URI [RFC7230]. | |||
| Section 9 and Section 10 discuss additional considerations for the | Section 9 and Section 10 discuss additional considerations for the | |||
| integration with HTTP. | integration with HTTP. | |||
| 6.1. Cache Interaction | 6.1. Cache Interaction | |||
| A DoH exchange can pass through a hierarchy of caches that include | A DoH exchange can pass through a hierarchy of caches that include | |||
| both HTTP and DNS specific caches. These caches may exist beteen the | both HTTP- and DNS-specific caches. These caches may exist between | |||
| DoH server and client, or on the DoH client itself. HTTP caches are | the DoH server and client, or on the DoH client itself. HTTP caches | |||
| by design generic; that is, they do not understand this protocol. | are by design generic; that is, they do not understand this protocol. | |||
| Even if a DoH client has modified its cache implementation to be | Even if a DoH client has modified its cache implementation to be | |||
| aware of DoH semantics, it does not follow that all upstream caches | aware of DoH semantics, it does not follow that all upstream caches | |||
| (for example, inline proxies, server-side gateways and Content | (for example, inline proxies, server-side gateways and Content | |||
| Delivery Networks) will be. | Delivery Networks) will be. | |||
| As a result, DoH servers need to carefully consider the HTTP caching | As a result, DoH servers need to carefully consider the HTTP caching | |||
| metadata they send in response to GET requests (POST requests are not | metadata they send in response to GET requests (POST requests are not | |||
| cacheable unless specific response headers are sent; this is not | cacheable unless specific response header fields are sent; this is | |||
| widely implemented, and not advised for DoH). | not widely implemented, and not advised for DoH). | |||
| In particular, DoH servers SHOULD assign an explicit freshness | In particular, DoH servers SHOULD assign an explicit freshness | |||
| lifetime ([RFC7234] Section 4.2) so that the DoH client is more | lifetime ([RFC7234] Section 4.2) so that the DoH client is more | |||
| likely to use fresh DNS data. This requirement is due to HTTP caches | likely to use fresh DNS data. This requirement is due to HTTP caches | |||
| being able to assign their own heuristic freshness (such as that | being able to assign their own heuristic freshness (such as that | |||
| described in [RFC7234] Section 4.2.2), which would take control of | described in [RFC7234] Section 4.2.2), which would take control of | |||
| the cache contents out of the hands of the DoH server. | the cache contents out of the hands of the DoH server. | |||
| The assigned freshness lifetime of a DoH HTTP response SHOULD be the | The assigned freshness lifetime of a DoH HTTP response MUST be less | |||
| smallest TTL in the Answer section of the DNS response. For example, | than or equal to the smallest TTL in the Answer section of the DNS | |||
| if a HTTP response carries three RRsets with TTLs of 30, 600, and | response. A freshness lifetime equal to the smallest TTL in the | |||
| 300, the HTTP freshness lifetime should be 30 seconds (which could be | Answer section is RECOMMENDED. For example, if a HTTP response | |||
| specified as "Cache-Control: max-age=30"). The assigned freshness | carries three RRsets with TTLs of 30, 600, and 300, the HTTP | |||
| lifetime MUST NOT be greater than the smallest TTL in the Answer | freshness lifetime should be 30 seconds (which could be specified as | |||
| section of the DNS response. This requirement helps assure that none | "Cache-Control: max-age=30"). This requirement helps assure that | |||
| of the RRsets contained in a DNS response are served stale from an | none of the RRsets contained in a DNS response are served stale from | |||
| HTTP cache. | an HTTP cache. | |||
| If the DNS response has no records in the Answer section, and the DNS | If the DNS response has no records in the Answer section, and the DNS | |||
| response has an SOA record in the Authority section, the response | response has an SOA record in the Authority section, the response | |||
| freshness lifetime MUST NOT be greater than the MINIMUM field from | freshness lifetime MUST NOT be greater than the MINIMUM field from | |||
| that SOA record (see [RFC2308]). | that SOA record (see [RFC2308]). | |||
| The stale-while-revalidate and stale-if-error Cache-Control | The stale-while-revalidate and stale-if-error Cache-Control | |||
| directives ([RFC5861]) could be well suited to a DoH implementation | directives ([RFC5861]) could be well-suited to a DoH implementation | |||
| when allowed by server policy. Those mechanisms allow a client, at | when allowed by server policy. Those mechanisms allow a client, at | |||
| the server's discretion, to reuse a cache entry that is no longer | the server's discretion, to reuse a cache entry that is no longer | |||
| fresh. In such a case, the client reuses all of a cached entry, or | fresh. In such a case, the client reuses all of a cached entry, or | |||
| none of it. | none of it. | |||
| DoH servers also need to consider caching when generating responses | DoH servers also need to consider caching when generating responses | |||
| that are not globally valid. For instance, if a DoH server | that are not globally valid. For instance, if a DoH server | |||
| customizes a response based on the client's identity, it would not | customizes a response based on the client's identity, it would not | |||
| want to allow global reuse of that response. This could be | want to allow global reuse of that response. This could be | |||
| accomplished through a variety of HTTP techniques such as a Cache- | accomplished through a variety of HTTP techniques such as a Cache- | |||
| Control max-age of 0, or by using the Vary response header ([RFC7231] | Control max-age of 0, or by using the Vary response header field | |||
| Section 7.1.4) to establish a secondary cache key ([RFC7234] | ([RFC7231] Section 7.1.4) to establish a secondary cache key | |||
| Section 4.1). | ([RFC7234] Section 4.1). | |||
| DoH clients MUST account for the Age response header's value | DoH clients MUST account for the Age response header field's value | |||
| ([RFC7234]) when calculating the DNS TTL of a response. For example, | ([RFC7234]) when calculating the DNS TTL of a response. For example, | |||
| if a RRset is received with a DNS TTL of 600, but the Age header | if an RRset is received with a DNS TTL of 600, but the Age header | |||
| indicates that the response has been cached for 250 seconds, the | field indicates that the response has been cached for 250 seconds, | |||
| remaining lifetime of the RRset is 350 seconds. | the remaining lifetime of the RRset is 350 seconds. This requirement | |||
| applies to both DoH client HTTP caches and DoH client DNS caches. | ||||
| DoH clients can request an uncached copy of a response by using the | DoH clients can request an uncached copy of a response by using the | |||
| "no-cache" request cache control directive ([RFC7234], | "no-cache" request cache control directive ([RFC7234], | |||
| Section 5.2.1.4) and similar controls. Note that some caches might | Section 5.2.1.4) and similar controls. Note that some caches might | |||
| not honor these directives, either due to configuration or | not honor these directives, either due to configuration or | |||
| interaction with traditional DNS caches that do not have such a | interaction with traditional DNS caches that do not have such a | |||
| mechanism. | mechanism. | |||
| HTTP conditional requests ([RFC7232]) may be of limited value to DoH, | HTTP conditional requests ([RFC7232]) may be of limited value to DoH, | |||
| as revalidation provides only a bandwidth benefit and DNS | as revalidation provides only a bandwidth benefit and DNS | |||
| transactions are normally latency bound. Furthermore, the HTTP | transactions are normally latency bound. Furthermore, the HTTP | |||
| response headers that enable revalidation (such as "Last-Modified" | response header fields that enable revalidation (such as "Last- | |||
| and "Etag") are often fairly large when compared to the overall DNS | Modified" and "Etag") are often fairly large when compared to the | |||
| response size, and have a variable nature that creates constant | overall DNS response size, and have a variable nature that creates | |||
| pressure on the HTTP/2 compression dictionary [RFC7541]. Other types | constant pressure on the HTTP/2 compression dictionary [RFC7541]. | |||
| of DNS data, such as zone transfers, may be larger and benefit more | Other types of DNS data, such as zone transfers, may be larger and | |||
| from revalidation. | benefit more from revalidation. | |||
| 6.2. HTTP/2 | 6.2. HTTP/2 | |||
| HTTP/2 [RFC7540] is the minimum RECOMMENDED version of HTTP for use | HTTP/2 [RFC7540] is the minimum RECOMMENDED version of HTTP for use | |||
| with DoH. | with DoH. | |||
| The messages in classic UDP based DNS [RFC1035] are inherently | The messages in classic UDP-based DNS [RFC1035] are inherently | |||
| unordered and have low overhead. A competitive HTTP transport needs | unordered and have low overhead. A competitive HTTP transport needs | |||
| to support reordering, parallelism, priority, and header compression | to support reordering, parallelism, priority, and header compression | |||
| to achieve similar performance. Those features were introduced to | to achieve similar performance. Those features were introduced to | |||
| HTTP in HTTP/2 [RFC7540]. Earlier versions of HTTP are capable of | HTTP in HTTP/2 [RFC7540]. Earlier versions of HTTP are capable of | |||
| conveying the semantic requirements of DoH but may result in very | conveying the semantic requirements of DoH but may result in very | |||
| poor performance. | poor performance. | |||
| 6.3. Server Push | 6.3. Server Push | |||
| Before using DoH response data for DNS resolution, the client MUST | Before using DoH response data for DNS resolution, the client MUST | |||
| establish that the HTTP request URI may be used for the DoH query. | establish that the HTTP request URI can be used for the DoH query. | |||
| For HTTP requests initiated by the DoH client this is implicit in the | For HTTP requests initiated by the DoH client, this is implicit in | |||
| selection of URI. For HTTP server push ([RFC7540] Section 8.2) extra | the selection of URI. For HTTP server push ([RFC7540] Section 8.2) | |||
| care must be taken to ensure that the pushed URI is one that the | extra care must be taken to ensure that the pushed URI is one that | |||
| client would have directed the same query to if the client had | the client would have directed the same query to if the client had | |||
| initiated the request. | initiated the request. | |||
| 6.4. Content Negotiation | 6.4. Content Negotiation | |||
| In order to maximize interoperability, DoH clients and DoH servers | In order to maximize interoperability, DoH clients and DoH servers | |||
| MUST support the "application/dns-message" media type. Other media | MUST support the "application/dns-message" media type. Other media | |||
| types MAY be used as defined by HTTP Content Negotiation ([RFC7231] | types MAY be used as defined by HTTP Content Negotiation ([RFC7231] | |||
| Section 3.4). Those media types MUST be flexible enough to express | Section 3.4). Those media types MUST be flexible enough to express | |||
| every DNS query that would normally be sent in DNS over UDP | every DNS query that would normally be sent in DNS over UDP | |||
| (including queries and responses that use DNS extensions, but not | (including queries and responses that use DNS extensions, but not | |||
| those that require multiple responses). | those that require multiple responses). | |||
| 7. Definition of the application/dns-message media type | 7. Definition of the application/dns-message media type | |||
| The data payload for the application/dns-message media type is a | The data payload for the application/dns-message media type is a | |||
| single message of the DNS on-the-wire format defined in Section 4.2.1 | single message of the DNS on-the-wire format defined in Section 4.2.1 | |||
| of [RFC1035]. The format was originally for DNS over UDP. Although | of [RFC1035], which in turn refers to the full wire format defined in | |||
| [RFC1035] says "Messages carried by UDP are restricted to 512 bytes", | Section 4.1 of that RFC. | |||
| that was later updated by [RFC6891]. This media type restricts the | ||||
| maximum size of the DNS message to 65535 bytes. Note that the wire | Although [RFC1035] says "Messages carried by UDP are restricted to | |||
| format used in this media type is different than the wire format used | 512 bytes", that was later updated by [RFC6891]. This media type | |||
| in [RFC7858] (which uses the format defined in Section 4.2.2 of | restricts the maximum size of the DNS message to 65535 bytes. | |||
| [RFC1035]). | ||||
| Note that the wire format used in this media type is different than | ||||
| the wire format used in [RFC7858] (which uses the format defined in | ||||
| Section 4.2.2 of [RFC1035] that includes two length bytes). | ||||
| DoH clients using this media type MAY have one or more EDNS options | DoH clients using this media type MAY have one or more EDNS options | |||
| [RFC6891] in the request. DoH servers using this media type MUST | [RFC6891] in the request. DoH servers using this media type MUST | |||
| ignore the value given for the EDNS UDP payload size in DNS requests. | ignore the value given for the EDNS UDP payload size in DNS requests. | |||
| When using the GET method, the data payload for this media type MUST | When using the GET method, the data payload for this media type MUST | |||
| be encoded with base64url [RFC4648] and then provided as a variable | be encoded with base64url [RFC4648] and then provided as a variable | |||
| named "dns" to the URI Template expansion. Padding characters for | named "dns" to the URI Template expansion. Padding characters for | |||
| base64url MUST NOT be included. | base64url MUST NOT be included. | |||
| skipping to change at page 13, line 7 ¶ | skipping to change at page 13, line 7 ¶ | |||
| Intended usage: COMMON | Intended usage: COMMON | |||
| Restrictions on usage: n/a | Restrictions on usage: n/a | |||
| Author: Paul Hoffman, paul.hoffman@icann.org | Author: Paul Hoffman, paul.hoffman@icann.org | |||
| Change controller: IESG | Change controller: IESG | |||
| 9. Privacy Considerations | 9. Privacy Considerations | |||
| [RFC7626] discusses DNS Privacy Considerations in both "On the wire" | [RFC7626] discusses DNS privacy considerations in both "On the wire" | |||
| (Section 2.4), and "In the server" (Section 2.5) contexts. This is | (Section 2.4), and "In the server" (Section 2.5) contexts. This is | |||
| also a useful framing for DoH's privacy considerations. | also a useful framing for DoH's privacy considerations. | |||
| 9.1. On The Wire | 9.1. On The Wire | |||
| DoH encrypts DNS traffic and requires authentication of the server. | DoH encrypts DNS traffic and requires authentication of the server. | |||
| This mitigates both passive surveillance [RFC7258] and active attacks | This mitigates both passive surveillance [RFC7258] and active attacks | |||
| that attempt to divert DNS traffic to rogue servers ([RFC7626] | that attempt to divert DNS traffic to rogue servers ([RFC7626] | |||
| Section 2.5.1). DNS over TLS [RFC7858] provides similar protections, | Section 2.5.1). DNS over TLS [RFC7858] provides similar protections, | |||
| while direct UDP and TCP based transports are vulnerable to this | while direct UDP and TCP based transports are vulnerable to this | |||
| class of attack. | class of attack. | |||
| Additionally, the use of the HTTPS default port 443 and the ability | Additionally, the use of the HTTPS default port 443 and the ability | |||
| to mix DoH traffic with other HTTPS traffic on the same connection | to mix DoH traffic with other HTTPS traffic on the same connection | |||
| can deter unprivileged on-path devices from interfering with DNS | can deter unprivileged on-path devices from interfering with DNS | |||
| operations and make DNS traffic analysis more difficult. | operations and make DNS traffic analysis more difficult. | |||
| 9.2. In The Server | 9.2. In The Server | |||
| The DNS wire format [RFC1035] contains no client identifiers, however | The DNS wire format [RFC1035] contains no client identifiers; | |||
| various transports of DNS queries and responses do provide data that | however, various transports of DNS queries and responses do provide | |||
| can be used to correlate requests. HTTPS presents new considerations | data that can be used to correlate requests. HTTPS presents new | |||
| for correlation such as explicit HTTP cookies and implicit | considerations for correlation, such as explicit HTTP cookies and | |||
| fingerprinting of the unique set and ordering of HTTP request | implicit fingerprinting of the unique set and ordering of HTTP | |||
| headers. | request header fields. | |||
| A DoH implementation is built on IP, TCP, TLS, and HTTP. Each layer | A DoH implementation is built on IP, TCP, TLS, and HTTP. Each layer | |||
| contains one or more common features that can be used to correlate | contains one or more common features that can be used to correlate | |||
| queries to the same identity. DNS transports will generally carry | queries to the same identity. DNS transports will generally carry | |||
| the same privacy properties of the layers used to implement them. | the same privacy properties of the layers used to implement them. | |||
| For example, the properties of IP, TCP, and TLS apply to DNS over TLS | For example, the properties of IP, TCP, and TLS apply to DNS over TLS | |||
| implementations. | implementations. | |||
| The privacy considerations of using the HTTPS layer in DoH are | The privacy considerations of using the HTTPS layer in DoH are | |||
| incremental to those of DNS over TLS. DoH is not known to introduce | incremental to those of DNS over TLS. DoH is not known to introduce | |||
| new concerns beyond those associated with HTTPS. | new concerns beyond those associated with HTTPS. | |||
| At the IP level, the client address provides obvious correlation | At the IP level, the client address provides obvious correlation | |||
| information. This can be mitigated by use of a NAT, proxy, VPN, or | information. This can be mitigated by use of a NAT, proxy, VPN, or | |||
| simple address rotation over time. It may be aggravated by use of a | simple address rotation over time. It may be aggravated by use of a | |||
| DNS server that can correlate real-time addressing information with | DNS server that can correlate real-time addressing information with | |||
| other personal identifiers, such as when a DNS server and DHCP server | other personal identifiers, such as when a DNS server and DHCP server | |||
| are operated by the same entity. | are operated by the same entity. | |||
| DNS implementations that use one TCP connection for multiple DNS | DNS implementations that use one TCP connection for multiple DNS | |||
| requests directly group those requests. Long lived connections have | requests directly group those requests. Long-lived connections have | |||
| better performance behaviors than short lived connections, but group | better performance behaviors than short-lived connections, but group | |||
| more requests. TCP-based solutions may also seek performance through | more requests. TCP-based solutions may also seek performance through | |||
| the use of TCP Fast Open [RFC7413]. The cookies used in TCP Fast | the use of TCP Fast Open [RFC7413]. The cookies used in TCP Fast | |||
| Open allow servers to correlate TCP sessions. | Open allow servers to correlate TCP sessions. | |||
| TLS based implementations often achieve better handshake performance | TLS-based implementations often achieve better handshake performance | |||
| through the use of some form of session resumption mechanism such as | through the use of some form of session resumption mechanism such as | |||
| session tickets [RFC5077]. Session resumption creates trivial | session tickets [RFC5077]. Session resumption creates trivial | |||
| mechanisms for a server to correlate TLS connections together. | mechanisms for a server to correlate TLS connections together. | |||
| HTTP's feature set can also be used for identification and tracking | HTTP's feature set can also be used for identification and tracking | |||
| in a number of different ways. For example, authentication request | in a number of different ways. For example, authentication request | |||
| header fields explicitly identify profiles in use, and HTTP Cookies | header fields explicitly identify profiles in use, and HTTP Cookies | |||
| are designed as an explicit state tracking mechanism between the | are designed as an explicit state-tracking mechanism between the | |||
| client and serving site and often are used as an authentication | client and serving site and often are used as an authentication | |||
| mechanism. | mechanism. | |||
| Additionally, the User-Agent and Accept-Language request header | Additionally, the User-Agent and Accept-Language request header | |||
| fields often convey specific information about the client version or | fields often convey specific information about the client version or | |||
| locale. This facilitates content negotiation and operational work- | locale. This facilitates content negotiation and operational work- | |||
| arounds for implementation bugs. Request header fields that control | arounds for implementation bugs. Request header fields that control | |||
| caching can expose state information about a subset of the client's | caching can expose state information about a subset of the client's | |||
| history. Mixing DoH requests with other HTTP requests on the same | history. Mixing DoH requests with other HTTP requests on the same | |||
| connection also provides an opportunity for richer data correlation. | connection also provides an opportunity for richer data correlation. | |||
| skipping to change at page 15, line 12 ¶ | skipping to change at page 15, line 12 ¶ | |||
| NOT be accepted by DOH clients unless they are explicitly required by | NOT be accepted by DOH clients unless they are explicitly required by | |||
| a use case. | a use case. | |||
| 10. Security Considerations | 10. Security Considerations | |||
| Running DNS over HTTPS relies on the security of the underlying HTTP | Running DNS over HTTPS relies on the security of the underlying HTTP | |||
| transport. This mitigates classic amplification attacks for UDP- | transport. This mitigates classic amplification attacks for UDP- | |||
| based DNS. Implementations utilizing HTTP/2 benefit from the TLS | based DNS. Implementations utilizing HTTP/2 benefit from the TLS | |||
| profile defined in [RFC7540] Section 9.2. | profile defined in [RFC7540] Section 9.2. | |||
| Session level encryption has well known weaknesses with respect to | Session-level encryption has well-known weaknesses with respect to | |||
| traffic analysis which might be particularly acute when dealing with | traffic analysis which might be particularly acute when dealing with | |||
| DNS queries. HTTP/2 provides further advice about the use of | DNS queries. HTTP/2 provides further advice about the use of | |||
| compression ([RFC7540] Section 10.6) and padding ([RFC7540] | compression ([RFC7540] Section 10.6) and padding ([RFC7540] | |||
| Section 10.7 ). DoH Servers can also add DNS padding [RFC7830] if | Section 10.7 ). DoH Servers can also add DNS padding [RFC7830] if | |||
| the DoH client requests it in the DNS query. | the DoH client requests it in the DNS query. An experimental effort | |||
| to offer guidance on choosing the padding length can be found in | ||||
| [I-D.ietf-dprive-padding-policy]. | ||||
| The HTTPS connection provides transport security for the interaction | The HTTPS connection provides transport security for the interaction | |||
| between the DoH server and client, but does not provide the response | between the DoH server and client, but does not provide the response | |||
| integrity of DNS data provided by DNSSEC. DNSSEC and DoH are | integrity of DNS data provided by DNSSEC. DNSSEC and DoH are | |||
| independent and fully compatible protocols, each solving different | independent and fully compatible protocols, each solving different | |||
| problems. The use of one does not diminish the need nor the | problems. The use of one does not diminish the need nor the | |||
| usefulness of the other. It is the choice of a client to either | usefulness of the other. It is the choice of a client to either | |||
| perform full DNSSEC validation of answers or to trust the DoH server | perform full DNSSEC validation of answers or to trust the DoH server | |||
| to do DNSSEC validation and inspect the AD (Authentic Data) bit in | to do DNSSEC validation and inspect the AD (Authentic Data) bit in | |||
| the returned message to determine whether an answer was authentic or | the returned message to determine whether an answer was authentic or | |||
| skipping to change at page 15, line 47 ¶ | skipping to change at page 15, line 49 ¶ | |||
| In the absence of DNSSEC information, a DoH server can give a client | In the absence of DNSSEC information, a DoH server can give a client | |||
| invalid data in response to a DNS query. Section 4 disallows the use | invalid data in response to a DNS query. Section 4 disallows the use | |||
| of DoH DNS responses that do not originate from configured servers. | of DoH DNS responses that do not originate from configured servers. | |||
| This prohibition does not guarantee protection against invalid data, | This prohibition does not guarantee protection against invalid data, | |||
| but it does reduce the risk. | but it does reduce the risk. | |||
| 11. Operational Considerations | 11. Operational Considerations | |||
| Local policy considerations and similar factors mean different DNS | Local policy considerations and similar factors mean different DNS | |||
| servers may provide different results to the same query: for instance | servers may provide different results to the same query, for instance | |||
| in split DNS configurations [RFC6950]. It logically follows that the | in split DNS configurations [RFC6950]. It logically follows that the | |||
| server which is queried can influence the end result. Therefore a | server that is queried can influence the end result. Therefore a | |||
| client's choice of DNS server may affect the responses it gets to its | client's choice of DNS server may affect the responses it gets to its | |||
| queries. For example, in the case of DNS64 [RFC6147], the choice | queries. For example, in the case of DNS64 [RFC6147], the choice | |||
| could affect whether IPv6/IPv4 translation will work at all. | could affect whether IPv6/IPv4 translation will work at all. | |||
| The HTTPS channel used by this specification establishes secure two | The HTTPS channel used by this specification establishes secure two- | |||
| party communication between the DoH client and the DoH server. | party communication between the DoH client and the DoH server. | |||
| Filtering or inspection systems that rely on unsecured transport of | Filtering or inspection systems that rely on unsecured transport of | |||
| DNS will not function in a DNS over HTTPS environment. | DNS will not function in a DNS over HTTPS environment. | |||
| Some HTTPS client implementations perform real time third party | Some HTTPS client implementations perform real time third-party | |||
| checks of the revocation status of the certificates being used by | checks of the revocation status of the certificates being used by | |||
| TLS. If this check is done as part of the DoH server connection | TLS. If this check is done as part of the DoH server connection | |||
| procedure and the check itself requires DNS resolution to connect to | procedure and the check itself requires DNS resolution to connect to | |||
| the third party a deadlock can occur. The use of OCSP [RFC6960] | the third party a deadlock can occur. The use of OCSP [RFC6960] | |||
| servers or AIA for CRL fetching ([RFC5280] Section 4.2.2.1) are | servers or AIA for CRL fetching ([RFC5280] Section 4.2.2.1) are | |||
| examples of how this deadlock can happen. To mitigate the | examples of how this deadlock can happen. To mitigate the | |||
| possibility of deadlock, DoH servers SHOULD NOT rely on DNS based | possibility of deadlock, DoH servers SHOULD NOT rely on DNS-based | |||
| references to external resources in the TLS handshake. For OCSP the | references to external resources in the TLS handshake. For OCSP, the | |||
| server can bundle the certificate status as part of the handshake | server can bundle the certificate status as part of the handshake | |||
| using a mechanism appropriate to the version of TLS, such as using | using a mechanism appropriate to the version of TLS, such as using | |||
| [RFC6066] Section 8 for TLS version 1.2. AIA deadlocks can be | [RFC6066] Section 8 for TLS version 1.2. AIA deadlocks can be | |||
| avoided by providing intermediate certificates that might otherwise | avoided by providing intermediate certificates that might otherwise | |||
| be obtained through additional requests. Note that these deadlocks | be obtained through additional requests. Note that these deadlocks | |||
| also need to be considered for server that a DoH server might | also need to be considered for server that a DoH server might | |||
| redirect to. | redirect to. | |||
| A DoH client may face a similar bootstrapping problem when the HTTP | A DoH client may face a similar bootstrapping problem when the HTTP | |||
| request needs to resolve the hostname portion of the DNS URI. Just | request needs to resolve the hostname portion of the DNS URI. Just | |||
| as the address of a traditional DNS nameserver cannot be originally | as the address of a traditional DNS nameserver cannot be originally | |||
| determined from that same server, a DoH client cannot use its DoH | determined from that same server, a DoH client cannot use its DoH | |||
| server to initially resolve the server's host name into an address. | server to initially resolve the server's host name into an address. | |||
| Alternative strategies a client might employ include making the | Alternative strategies a client might employ include making the | |||
| initial resolution part of the configuration, IP based URIs and | initial resolution part of the configuration, IP-based URIs and | |||
| corresponding IP based certificates for HTTPS, or resolving the DNS | corresponding IP-based certificates for HTTPS, or resolving the DNS | |||
| API server's hostname via traditional DNS or another DoH server while | API server's hostname via traditional DNS or another DoH server while | |||
| still authenticating the resulting connection via HTTPS. | still authenticating the resulting connection via HTTPS. | |||
| HTTP [RFC7230] is a stateless application level protocol and | HTTP [RFC7230] is a stateless application-level protocol and | |||
| therefore DoH implementations do not provide stateful ordering | therefore DoH implementations do not provide stateful ordering | |||
| guarantees between different requests. DoH cannot be used as a | guarantees between different requests. DoH cannot be used as a | |||
| transport for other protocols that require strict ordering. | transport for other protocols that require strict ordering. | |||
| A DoH server is allowed to answer queries with any valid DNS | A DoH server is allowed to answer queries with any valid DNS | |||
| response. For example, a valid DNS response might have the TC | response. For example, a valid DNS response might have the TC | |||
| (truncation) bit set in the DNS header to indicate that the server | (truncation) bit set in the DNS header to indicate that the server | |||
| was not able to retrieve a full answer for the query but is providing | was not able to retrieve a full answer for the query but is providing | |||
| the best answer it could get. A DoH server can reply to queries with | the best answer it could get. A DoH server can reply to queries with | |||
| an HTTP error for queries that it cannot fulfill. In this same | an HTTP error for queries that it cannot fulfill. In this same | |||
| skipping to change at page 18, line 42 ¶ | skipping to change at page 18, line 47 ¶ | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| 12.2. Informative References | 12.2. Informative References | |||
| [CORS] "Cross-Origin Resource Sharing", n.d., | [CORS] "Cross-Origin Resource Sharing", n.d., | |||
| <https://fetch.spec.whatwg.org/#http-cors-protocol>. | <https://fetch.spec.whatwg.org/#http-cors-protocol>. | |||
| [I-D.ietf-dprive-padding-policy] | ||||
| Mayrhofer, A., "Padding Policy for EDNS(0)", draft-ietf- | ||||
| dprive-padding-policy-06 (work in progress), July 2018. | ||||
| [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, | [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, | |||
| DOI 10.17487/RFC2818, May 2000, | DOI 10.17487/RFC2818, May 2000, | |||
| <https://www.rfc-editor.org/info/rfc2818>. | <https://www.rfc-editor.org/info/rfc2818>. | |||
| [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, | [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, | |||
| "Transport Layer Security (TLS) Session Resumption without | "Transport Layer Security (TLS) Session Resumption without | |||
| Server-Side State", RFC 5077, DOI 10.17487/RFC5077, | Server-Side State", RFC 5077, DOI 10.17487/RFC5077, | |||
| January 2008, <https://www.rfc-editor.org/info/rfc5077>. | January 2008, <https://www.rfc-editor.org/info/rfc5077>. | |||
| [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | |||
| skipping to change at page 20, line 23 ¶ | skipping to change at page 20, line 31 ¶ | |||
| [RFC7858] Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., | [RFC7858] Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., | |||
| and P. Hoffman, "Specification for DNS over Transport | and P. Hoffman, "Specification for DNS over Transport | |||
| Layer Security (TLS)", RFC 7858, DOI 10.17487/RFC7858, May | Layer Security (TLS)", RFC 7858, DOI 10.17487/RFC7858, May | |||
| 2016, <https://www.rfc-editor.org/info/rfc7858>. | 2016, <https://www.rfc-editor.org/info/rfc7858>. | |||
| Acknowledgments | Acknowledgments | |||
| This work required a high level of cooperation between experts in | This work required a high level of cooperation between experts in | |||
| different technologies. Thank you Ray Bellis, Stephane Bortzmeyer, | different technologies. Thank you Ray Bellis, Stephane Bortzmeyer, | |||
| Manu Bretelle, Sara Dickinson, Tony Finch, Daniel Kahn Gilmor, Olafur | Manu Bretelle, Sara Dickinson, Massimiliano Fantuzzi, Tony Finch, | |||
| Guomundsson, Wes Hardaker, Rory Hewitt, Joe Hildebrand, David | Daniel Kahn Gilmor, Olafur Gudmundsson, Wes Hardaker, Rory Hewitt, | |||
| Lawrence, Eliot Lear, John Mattsson, Alex Mayrhofer, Mark Nottingham, | Joe Hildebrand, David Lawrence, Eliot Lear, John Mattsson, Alex | |||
| Jim Reid, Adam Roach, Ben Schwartz, Davey Song, Daniel Stenberg, | Mayrhofer, Mark Nottingham, Jim Reid, Adam Roach, Ben Schwartz, Davey | |||
| Andrew Sullivan, Martin Thomson, and Sam Weiler. | Song, Daniel Stenberg, Andrew Sullivan, Martin Thomson, and Sam | |||
| Weiler. | ||||
| Previous Work on DNS over HTTP or in Other Formats | Previous Work on DNS over HTTP or in Other Formats | |||
| The following is an incomplete list of earlier work that related to | The following is an incomplete list of earlier work that related to | |||
| DNS over HTTP/1 or representing DNS data in other formats. | DNS over HTTP/1 or representing DNS data in other formats. | |||
| The list includes links to the tools.ietf.org site (because these | The list includes links to the tools.ietf.org site (because these | |||
| documents are all expired) and web sites of software. | documents are all expired) and web sites of software. | |||
| o https://tools.ietf.org/html/draft-mohan-dns-query-xml | o https://tools.ietf.org/html/draft-mohan-dns-query-xml | |||
| End of changes. 43 change blocks. | ||||
| 94 lines changed or deleted | 111 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||