Networking

DNS Over HTTPS (DoH) Explained: How It Works and What It Hides

DNS over HTTPS (DoH) sends your DNS lookups, the step that turns a name like example.com into an IP address, inside an encrypted HTTPS connection on port 443 instead of as plain-text packets on port 53. Anyone between you and the resolver, such as the Wi-Fi network or your internet provider, can no longer read or tamper with which names you look up; the resolver you send them to still sees all of them.

DoH is defined in RFC 8484, published in October 2018. Windows 11 and the major browsers can use it, but in Windows it stays off until you choose a resolver that supports it and turn it on.

What problem DoH solves

Classic DNS (how DNS works covers the full lookup) sends each question and answer as an unencrypted UDP packet, usually to port 53. Anyone on the path can read it and, in principle, answer first with a fake reply. RFC 8484 names two goals: "preventing on-path devices from interfering with DNS operations", and letting web applications look up DNS information through normal browser APIs. Because DoH runs over HTTPS, it inherits HTTPS's encryption and its check that you're talking to the real server. The RFC notes that plain UDP and TCP DNS "are vulnerable to this class of attack" and DoH is not.

How DNS over HTTPS works

The client is configured with a URL template for the resolver, such as https://cloudflare-dns.com/dns-query or https://dns.google/dns-query. For each lookup it builds a normal binary DNS message and sends it to that URL in one of two ways:

  • GET: the DNS message is base64url-encoded (without padding) and passed in a dns query parameter.
  • POST: the raw DNS message is the request body, with Content-Type: application/dns-message.

The answer comes back as an ordinary DNS message with the same media type. RFC 8484 requires servers to support both methods, requires the https scheme (so TLS, on port 443 by default), and recommends HTTP/2 as the minimum HTTP version. Because one HTTPS connection carries many queries, the cost of setting up encryption is paid once and then reused. HTTP caching is allowed too: a DoH response may not be cached for longer than the smallest TTL in its answer, the same limit ordinary DNS caches follow.

DoH vs DoT vs plain DNS

Plain DNSDNS over TLS (DoT)DNS over HTTPS (DoH)
StandardOriginal DNS RFCsRFC 7858 (May 2016)RFC 8484 (October 2018)
Port53 (UDP, sometimes TCP)853 (TCP)443 (HTTPS)
EncryptedNoYesYes
Easy for a network to spot and blockYesYes, by port 853Hard: looks like other HTTPS traffic

Both encrypted options protect the content of lookups equally. The practical difference is the port. RFC 7858 says DoT servers listen on port 853 by default, which a network administrator can easily allow or block. DoH shares port 443 with all other web traffic, which RFC 8484 says can "deter unprivileged on-path devices from interfering with DNS operations". That property is exactly why some network administrators dislike it: it also bypasses DNS-based filtering they rely on. The article on common port numbers lists where 53, 443 and 853 fit.

Try DNS over HTTPS with curl

Cloudflare and Google also offer a JSON variant of DoH that's readable by humans (it's an extension of each provider, not part of RFC 8484). This is a real query and its output:

curl -s -H "accept: application/dns-json" "https://cloudflare-dns.com/dns-query?name=example.com&type=A"
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,
 "Question":[{"name":"example.com","type":1}],
 "Answer":[{"name":"example.com","type":1,"TTL":69,"data":"172.66.147.243"},
           {"name":"example.com","type":1,"TTL":69,"data":"104.20.23.154"}]}

Status 0 means no error, type 1 is an A record, and AD: true means the resolver validated the answer with DNSSEC. Google's equivalent is https://dns.google/resolve?name=example.com&type=A; Google documents it as GET-only and separate from its RFC 8484 endpoint at /dns-query.

curl can also use DoH for its own name lookups, so a whole request resolves through the encrypted resolver:

curl --doh-url https://cloudflare-dns.com/dns-query https://example.com/

On Windows 11, the built-in curl.exe (version 8.13 on the machine we tested) completed this request with HTTP 200. The curl manual notes that by default curl looks up the DoH server's own name without DoH, and that --resolve can pin that server's IP address to avoid even that one plain lookup.

What DoH hides, and what it doesn't

DoH protects the lookup on the wire. It doesn't make you anonymous:

  • The resolver sees everything. You've moved trust from your provider's resolver to the DoH provider. Pick one whose privacy policy you accept.
  • The IP addresses you connect to are still visible. After the lookup your device connects to the site's address in the open, and RFC 8484's security section notes that encryption alone has "well-known weaknesses with respect to traffic analysis".
  • HTTP adds identifiers DNS never had. The RFC points out that plain DNS messages contain no client identifiers, while HTTP can carry cookies, and says DoH clients "SHOULD NOT" accept cookies unless a use case requires them. Google's DoH guide likewise tells implementers to send only the headers DoH needs.
  • Answers are only as honest as the resolver. HTTPS proves you reached the resolver; it doesn't prove the resolver's answer is right. RFC 8484 says HTTPS "does not provide the response integrity of DNS data provided by DNSSEC", so validating DNSSEC, or trusting a resolver that does, is a separate layer.

How to turn on DNS over HTTPS

Windows 11

Windows 11 ships with a list of resolvers it knows support DoH. Print it with PowerShell:

Get-DnsClientDohServerAddress

Example output (trimmed):

ServerAddress   AllowFallbackToUdp AutoUpgrade DohTemplate
-------------   ------------------ ----------- -----------
1.1.1.1         False              False       https://cloudflare-dns.com/dns-query
8.8.8.8         False              False       https://dns.google/dns-query
9.9.9.9         False              False       https://dns.quad9.net/dns-query

Set one of those addresses as your DNS server and the DNS over HTTPS option becomes available in the same Settings dialog. Step-by-step instructions, including the Fallback to plaintext switch, are in how to change DNS server on Windows. A resolver that isn't on the list can be added with Add-DnsClientDohServerAddress, giving its IP address and template URL.

Browsers

Chrome, Edge and Firefox have their own secure DNS setting in their privacy or security settings, independent of the operating system. In Chrome the setting is on the chrome://settings/security page. When a browser's own DoH is on, it ignores the DNS server Windows is configured with, which explains many "I changed my DNS but nothing happened" puzzles.

When DoH causes problems

  • Company networks. Internal names only resolve on internal DNS servers. Microsoft's documentation warns against requiring DoH on domain-joined computers because Active Directory relies heavily on DNS and the Windows Server DNS service doesn't support DoH queries.
  • Parental controls and filtering. Filters that work by answering DNS queries on the router are bypassed when a device sends its lookups straight to a public DoH resolver.
  • Captive portals. Hotel and café Wi-Fi often needs its own DNS to show the login page; strict DoH with no fallback can block that until you sign in.
  • Networks that block it. With "encrypted only" and no plaintext fallback, lookups fail outright on a network that blocks the resolver. Allowing fallback trades that failure for occasional unencrypted lookups, and Microsoft notes you won't be told when it falls back.

Frequently asked questions

Does DNS over HTTPS hide my browsing from my internet provider?
It hides the names you look up, but not where you then connect. Your provider still sees the IP address of every server your device talks to, and many sites can be identified from that alone. DoH also moves visibility rather than removing it: the DoH resolver you choose sees every lookup instead of your provider's resolver.
Is DoH the same as a VPN?
No. DoH encrypts only DNS lookups. A VPN encrypts all traffic between your device and the VPN server, including DNS if it is configured to send DNS through the tunnel. With DoH alone, the rest of your traffic travels exactly as before.
Does DNS over HTTPS slow down browsing?
Setting up the encrypted connection costs some time on the first lookup, but the connection is then reused for later queries, and answers are cached as with ordinary DNS. Whether it ends up faster or slower than your current DNS depends mostly on how close and quick the chosen resolver is, so test both.
Should I turn on DoH on a work computer?
Follow your organisation's policy. Company networks often rely on internal DNS servers for internal names and for security filtering. Microsoft specifically advises against requiring DoH on domain-joined computers, because Active Directory depends on DNS and Windows Server's DNS service does not answer DoH queries.

Sources