RFC 8484: DNS over HTTPS
Summary
In October 2018, Paul Hoffman of ICANN and Patrick McManus of Mozilla specified in RFC 8484 how DNS queries run over HTTPS. DNS over HTTPS wraps the familiar binary DNS message as an HTTP request with the media type application/dns-message and thereby uses the web's caches, connections and TLS. Because the traffic looks like ordinary HTTPS, the method protects against eavesdroppers and at the same time removes DNS from control within the local network.
DNS as an HTTP message
A DoH server must support GET and POST. With GET, the DNS message is base64url-encoded in the dns parameter, which suits HTTP caches; POST requests are usually smaller.
So that identical questions produce identical requests, the DNS ID should always be 0. Otherwise every request would produce a different URL and no cache could reuse it.
Whom you trust instead
With DoH, the choice of resolver moves from the network to the application: a browser can contact its own resolver, bypassing the operating system's configuration. This protects on foreign networks but also bypasses filters and internal names on your own.
RFC 8484 only specifies the protocol. Which resolvers an application uses and how it falls back is left open by the document.
Ideas
- DNS messages travel unchanged in binary format inside HTTPS.
- GET with a base64url parameter is cache-friendly, POST saves bytes.
- A DNS ID of 0 makes identical queries cacheable.
- HTTP/2 bundles many DNS queries on one connection.
- DoH traffic is hard to distinguish from other HTTPS traffic.
Insights
- Moving DNS into an application also moves the decision about whom name resolution is entrusted to.
- The same property protects against foreign network operators and makes filtering and troubleshooting harder for your own network.
Facts
- RFC 8484 appeared in October 2018 as a Proposed Standard.
- The media type application/dns-message was registered by RFC 8484.
- DoH servers must support both GET and POST.
- The DNS ID 0 should be used for queries.
References
- RFC 8484: DNS Queries over HTTPS (DoH)
- RFC 7858: Specification for DNS over Transport Layer Security (TLS) (2016)
Remarks
- curl can use DoH directly: --doh-url sets the resolver for name resolution.
Recommendations
- Decide on your own network whether applications may use DoH, and document it.
- Resolve internal names only via resolvers that know that zone.
- When troubleshooting, remember that browsers may use a different resolver than the system.
Read the RFC at the RFC Editor
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.