cheat-sheets

DNS over HTTPS (DoH)

DoH sends DNS queries inside HTTPS (TLS (Transport Layer Security)) on TCP port 443, as defined in RFC 8484. It looks like normal web traffic. Compare with DNS over TLS (DoT) and see the overview in DNS Encryption.

Public Endpoints #

PROVIDERURL
Cloudflarehttps://cloudflare-dns.com/dns-query
Googlehttps://dns.google/dns-query
Quad9https://dns.quad9.net/dns-query

Testing #

COMMANDDESCRIPTION
curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=example.com&type=A' | jqJSON query to Cloudflare
curl -s 'https://dns.google/resolve?name=example.com&type=A' | jqJSON query to Google
q example.com @https://dns.google/dns-queryWire-format query with the q tool
dig +https @dns.google example.comQuery over DoH (dig 9.18+)

Browsers #

BROWSERWHERE
FirefoxSettings > Privacy & Security > DNS over HTTPS
Chrome / EdgeSettings > Privacy and security > Security > Use secure DNS
Windows 11Settings > Network & internet > (adapter) > DNS server assignment > Encrypted

Run a Local DoH Proxy #

Stub resolvers that listen on 127.0.0.1:53 and forward over HTTPS:

TOOLNOTES
cloudflared proxy-dnsCloudflare’s proxy
dnscrypt-proxySupports DoH, DoT-like and DNSCrypt, with blocklists
AdGuard Home / Pi-hole + cloudflaredFiltering resolver with DoH upstream
Technitium DNSSelf-hosted resolver with DoH

dnscrypt-proxy dnscrypt-proxy.toml:

toml
server_names = ['cloudflare', 'google']
listen_addresses = ['127.0.0.1:53']
doh_servers = true
dnscrypt_servers = false
require_dnssec = true

Caveats #

  • Browser DoH bypasses local DNS filtering and split-horizon names. Enterprises usually disable it with the Firefox canary domain use-application-dns.net.
  • DoH hides queries from the network but not from the resolver. Pick one you trust.
  • The SNI in the TLS handshake may still reveal the server name unless ECH is used.
Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.