Protocol ExplorerGuidesPricing

DNS over HTTPS (DoH): Queries, Privacy and Limits

DNS over HTTPS sends DNS messages to a configured resolver through an HTTPS exchange. It protects the client-to-resolver path, but it does not hide a query from that resolver or make DNS anonymous.

Updated · Editorial approach and simulation limits

DoH maps one DNS query and response to HTTP

RFC 8484 defines DNS Queries over HTTPS. A client first establishes an authenticated HTTPS connection to a configured DoH server, then maps a DNS query message into an HTTP request. The server returns a DNS response message in the corresponding HTTP response. The DNS message format remains recognizable to DNS implementations; HTTP provides the transport and request semantics.

This is more than placing arbitrary DNS bytes inside an encrypted tunnel. RFC 8484 defines the media type application/dns-message and uses HTTP content negotiation. A resolver can also expose a URI template for GET requests. The client and server still need to agree on the endpoint and support the applicable HTTP behavior.

The word configured matters. DoH does not automatically mean the browser uses a particular public resolver. An operating system, browser, application or managed network can select the resolver according to its settings and policy.

GET and POST carry the DNS message differently

For GET, the client encodes the DNS wire-format message using base64url and places it in the dns query parameter of the configured URI template. This makes the request body unnecessary, but the full URI can be visible in client-side history, resolver logs, proxies or diagnostics if those systems record it.

For POST, the DNS message is sent as the request body with Content-Type application/dns-message. The response also uses that media type. POST avoids putting the encoded question in the URI, but it does not eliminate logging or make the selected resolver unable to read the query after TLS termination.

When inspecting an endpoint trace, verify the method, endpoint and media type before decoding the DNS payload. A wrong content type, malformed base64url value or unsupported endpoint can fail at the HTTP layer before the DNS resolver evaluates the question.

HTTP status and DNS response codes answer different questions

A successful HTTP response can carry a DNS response whose DNS RCODE is NXDOMAIN or SERVFAIL. In that case, HTTP successfully transported a DNS answer that reports a DNS-level outcome. Conversely, an HTTP error such as 401, 404 or 415 means the HTTP exchange did not provide a usable answer to the DNS query.

This distinction is essential when reading browser developer tools. A 200 response does not prove that the requested domain exists; decode the DNS message and inspect its response code and answer section. A non-2xx HTTP status should be diagnosed as an endpoint, authentication, media-type or HTTP problem before treating it as a DNS failure.

DoH clients follow HTTP semantics for redirects and errors as well as DNS semantics for the returned message. RFC 8484 specifically discusses how clients may retry in response to selected HTTP status codes.

What DoH protects, and what the resolver still knows

TLS protects the client-to-resolver exchange from passive observers on that path and helps the client authenticate the HTTPS server. An on-path network observer generally cannot read the DNS question from a properly protected session, although timing, destination, traffic volume and other metadata may remain observable.

The resolver receives the DNS question in order to answer it. It can learn the queried name, the client context available to it, and the time of the request. DoH shifts which operator can observe the query; it does not remove the need to trust the chosen resolver or its retention policy.

A resolver can return a different answer from another resolver because of policy, split-horizon DNS, filtering, CDN steering or network location. Choosing a DoH server can therefore change resolution results as well as privacy properties.

DoH, DoT and DNSSEC protect different parts of DNS

DNS over TLS, specified in RFC 7858, also encrypts the client-to-resolver connection but uses a dedicated TLS service rather than mapping each query into an HTTP exchange. DoH uses HTTP infrastructure and can fit existing browser and web client APIs. Neither transport by itself proves that the answer data is cryptographically authentic.

DNSSEC adds origin authentication and data integrity to DNS data through signatures and a chain of trust. It does not encrypt the query name. A validating resolver can check DNSSEC on behalf of a client, and some clients can validate themselves; the deployment determines where validation occurs.

A practical comparison is: DoH or DoT can protect the transport path to a selected resolver; DNSSEC can help validate signed DNS data; and an encrypted transport does not make the resolver a trustworthy party by itself. These mechanisms can be used together.

How to read a DoH packet capture

On a network-side capture without TLS decryption, identify the resolver IP address, TLS handshake and connection timing. You can often tell that the client is contacting an HTTPS service, but you cannot infer the exact DNS question from encrypted application records. A visible SNI value, when present, is not the same thing as the DNS payload and can be affected by other TLS features.

At an authorized client or resolver endpoint, inspect the HTTP method, URI template or request body, content type, response status and decoded DNS question. Then compare the DNS transaction ID, question name and type with the returned DNS response. Do not confuse an HTTP response status with the DNS RCODE.

For troubleshooting, check bootstrap resolution of the DoH hostname, certificate validation, proxy behavior, HTTP/2 or HTTP/3 support in the client stack, endpoint configuration and resolver policy. A circular dependency can occur if a client needs the DoH service’s DNS name resolved through the very service it has not yet reached.

Caching, privacy and operational trade-offs

DoH inherits useful HTTP properties such as caching, redirection, proxying, authentication and compression, while the DNS message still has its own TTLs and caching rules. A cached HTTP representation must not be treated as an answer with unlimited lifetime; clients and intermediaries must respect the protocol’s cache semantics.

DNS queries can reveal browsing and application activity. Operators should consider URI logging for GET, request-body logging for POST, cache policy, account linkage and retention. RFC 8484 also warns about cookies and other HTTP state; clients should not accept cookies unless their use case explicitly requires them.

Protocol Explorer’s lesson illustrates a scripted exchange. It does not contact a resolver or measure privacy on your network. Use the RFC and your client’s documented resolver configuration to verify an actual DoH deployment.

Explore DNS over HTTPS interactively

Open the matching lesson to follow the exchange packet by packet. This is a scripted learning model with illustrative timing, not a capture of your network. The overview is free; the full lesson is included with the one-time Pro pass.

Open the DNS over HTTPS animation · Compare Free and Pro

Standards and primary sources

Use these specifications for authoritative protocol requirements. The lesson summarizes selected behaviors and does not replace the source documents.

Related protocol lessons

Browse all application protocols ·

  • Encrypted DNS vs DNSSEC: what each protects