What is DNS over HTTPS?
DNS over HTTPS, or DoH, sends your DNS questions inside an encrypted HTTPS connection instead of as plain UDP packets on port 53. The question and answer are the same DNS messages as before; only the envelope changes.
Plain DNS lets anyone on the path, such as a shared Wi-Fi or a provider, read and even change the names you look up. DoH hides those names and protects the answers from tampering on the way. Most browsers and phones can turn it on with one setting.
Think of it like this. Plain DNS is like asking for directions by shouting across a crowded room: everyone hears where you are going. DoH is like passing a sealed note to the person at the desk. People can see you talked to the desk, but not what you asked.
Step by step
Lookup in HTTPS
4 stepsThe browser opens one HTTPS connection to its DoH resolver and sends DNS questions inside it.
Lookup in HTTPS
4 stepsThe browser opens one HTTPS connection to its DoH resolver and sends DNS questions inside it.
- 1
Open a connection
TCP to port 443
The browser connects to the DoH resolver the same way it connects to any website. It does this once and keeps the connection open for many lookups.
- 2
TLS handshake
Keys agreed, certificate checked
The resolver proves its name with a certificate. From here on every byte is encrypted, so the cafe Wi-Fi and your provider cannot read the questions.
- 3
Ask inside HTTPS
GET /dns-query?dns=...
The DNS question is the same binary message as normal DNS. It is base64url coded into the address of an HTTP GET, or sent as the body of a POST, with the type application/dns-message.
- 4
Answer comes back
200 OK with the DNS answer
The reply carries a normal DNS answer inside an HTTP response. The browser then connects to the website as usual.
What others see
3 stepsThe same lookup twice on cafe Wi-Fi: plain DNS that a stranger reads, then DoH that hides the name.
What others see
3 stepsThe same lookup twice on cafe Wi-Fi: plain DNS that a stranger reads, then DoH that hides the name.
- 1
Plain DNS
UDP port 53, readable
Arjun's laptop asks the cafe router for clinic.example.org over plain DNS. The question and the answer travel as readable data.
- 2
Stranger reads it
The name is in the clear
A stranger capturing Wi-Fi traffic can read every name the laptop looks up, even though the website itself uses HTTPS. A plain answer can also be changed on the way.
- 3
Same lookup with DoH
Port 443, encrypted
With secure DNS turned on, the question goes inside the open HTTPS connection to the DoH resolver. The stranger sees encrypted bytes going to dns.example.net and nothing more.
Resolver blocked
3 stepsA network blocks the DoH resolver, so the browser gives up on it and falls back to plain DNS.
Resolver blocked
3 stepsA network blocks the DoH resolver, so the browser gives up on it and falls back to plain DNS.
- 1
Try the DoH resolver
No reply to SYN
Some office and school networks block known DoH resolvers. The browser sends SYN to port 443 and nothing comes back.
- 2
Retry and wait
TCP tries again after a second
TCP resends the SYN after about one second. When that fails too, the browser marks the resolver as not reachable for now.
- 3
Fall back
Plain DNS to the local router
In automatic mode the browser falls back to the network's own resolver, so pages still load but lookups are readable again. In strict mode it shows an error instead of falling back.
Myths and mix-ups
- DoH does not hide everything: the DoH resolver still sees every name you ask, so you are choosing whom to trust.
- DoH does not hide which website you visit from the network; the site's IP address and often its name in the TLS hello are still visible.
- DoH does not make DNS slow; the connection stays open, so after the first lookup it is often as fast as plain DNS.
- DoH is not a new kind of DNS: the questions and answers inside are the exact same messages.
Try it yourself
Run these on your own computer to see DNS over HTTPS at work.
See which lookups use DoH (Firefox)
about:networking#dnsType it in the address bar. The TRR column shows true for names looked up over DoH.
Check the setting (Chrome or Edge)
Settings > Privacy and security > Security > Use secure DNSTurn it on and pick a provider, or keep your current one if it supports DoH.
List known DoH servers (Windows 11)
netsh dns show encryptionShows which resolver addresses Windows can upgrade to DoH automatically.
Fetch a page using DoH (curl)
curl -v --doh-url https://dns.example.net/dns-query https://example.com/Put your DoH resolver's address after --doh-url. The verbose output shows the DoH request.
DNS over HTTPS at a glance
- Layer
- Application (7)
- Port
- 443, the same as HTTPS
- Transport
- HTTP/2 over TCP, or HTTP/3 over QUIC
- Media type
- application/dns-message
- Methods
- GET with ?dns= in the address, or POST
- Defined
- 2018 (RFC 8484)
- Sister protocol
- DNS over TLS, port 853 (RFC 7858)
Defined inRFC 8484
Header fields
What DNS over HTTPS puts in its messages, with example values from the stories above.
DNS
- Transaction ID
0x4a1e- Query
clinic.example.org, type A, class INReadable by anyone who captures the packet.- Answer
clinic.example.org A 203.0.113.80, TTL 300
Captured
- Seen by stranger
clinic.example.orgNames alone can reveal health, money or private interests.
Test yourself
Which port does DNS over HTTPS use?
Questions people ask
What is DNS over HTTPS?
It is a way to send DNS lookups inside an encrypted HTTPS connection, so people on the same network cannot see or change which names you look up.
Is DNS over HTTPS safe to turn on?
Yes. It protects lookups on the way to the resolver. Pick a resolver you trust, because it still sees the names you ask for.
What is the difference between DoH and DoT?
Both encrypt DNS. DoT (DNS over TLS) uses its own port, 853, so networks can spot and block it easily. DoH uses port 443 and blends in with web traffic.
Does DNS over HTTPS hide my browsing from my internet provider?
It hides your DNS lookups, but your provider can still see the IP addresses you connect to and, in many cases, the site name in the TLS hello.
Does DoH slow down browsing?
Usually not. The first lookup needs a TLS handshake, but the connection is reused for later lookups, so they are about as fast as plain DNS.