Guide

Private DNS Explained: What DoH and DoT Really Hide

Last updated: 30 November 2026

Every time you visit a site, your device first asks a DNS resolver for its address. Encrypted DNS protects that question on the way to the resolver, but it does not make your browsing invisible.

Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works

DoH and DoT in plain words

Classic DNS travels unencrypted, so anyone on the path, such as the operator of a public Wi-Fi network or your internet provider, can read or change it. Two standards add encryption:

Both protect the link between your device and the resolver. Neither is automatically more private than the other. The bigger decision is which resolver you trust.

What it hides and what it does not

Who or whatWhat can still be seen
The resolver you choseEvery name you look up, and the IP address you connect from
Your network or internet providerThe server IP addresses you connect to, timing and traffic volume
Network observers during HTTPS setupOften the site name, in a field called SNI
The websiteYour IP address and what you do there

A newer TLS feature called Encrypted Client Hello can hide the real site name, but it only works when both the browser and the site support it, and IP addresses remain visible. Encrypted DNS is also not a VPN: it does not change your IP address.

So encrypted DNS is useful against tampering and casual logging of lookups on the local network. You are moving trust from the network to the resolver, so read the resolver's privacy policy.

Setting it up on your devices

Know which setting wins. A browser with its own DoH can bypass the resolver set in the operating system or on your router, including your filtering. A VPN may also replace your DNS settings. Test after setup: some resolvers offer a check page, and your own resolver's query log will show whether requests arrive.

If a hotel or airport login page will not appear, strict encrypted DNS may be the reason. Switch it off briefly, sign in, and turn it back on.

Running your own resolver safely

A resolver that answers anyone on the internet is called an open resolver. It can be abused to flood third parties with traffic, which may break your provider's rules and get your server restricted. Do not leave port 53 reachable by the public.

The simplest safe design is to run the resolver on a server and reach it only through a VPN such as WireGuard. With the Unbound resolver, bind it to the VPN address and allow only the VPN range (adjust the addresses to yours):

server:
  interface: 127.0.0.1
  interface: 10.8.0.1
  access-control: 127.0.0.0/8 allow
  access-control: 10.8.0.0/24 allow
  access-control: 0.0.0.0/0 refuse

Run unbound-checkconf before restarting. The VPN interface must exist when Unbound starts. Add a firewall rule as a second layer, and keep your SSH rule in place before enabling any firewall. See UFW on a VPS. Note that ports published by Docker containers can bypass UFW rules.

If you prefer a web interface, AdGuard Home offers DoH and DoT. Its documentation recommends an allowed clients list for public instances, found under DNS settings, Access settings, and explains how to disable plain DNS. Use a strong password for the admin page and do not expose it more than needed.

Test it and understand the trade-off

From a device connected to your VPN, a lookup should work:

dig example.com @10.8.0.1

From a network outside the VPN, the same kind of query to the server's public address should time out or be refused:

dig example.com @YOUR_SERVER_IP

Your own resolver means no third-party DNS company receives your queries in one list. But your server still has to ask other DNS servers, those lookups are normally not encrypted, and they come from your server's IP address. If you are the only user, that traffic is easy to link to you. Forwarding to an upstream resolver over DoT encrypts that step but shows your queries to that resolver again.

Keep the server patched with automatic security updates, and have a fallback in mind: if your only resolver goes down, names stop resolving on every device that depends on it. A VPS with root access, for example from our Instant VPS page, is enough to try this; please use it lawfully and within the AUP.

Questions and answers

Does encrypted DNS hide which sites I visit from my provider?
Not fully. It hides the DNS lookups, but your provider still sees the IP addresses you connect to and often the site name during the HTTPS handshake.

Should I use DoH or DoT?
Use whichever your device supports well. DoT is simple to recognise and manage on a network; DoH is harder to tell apart from web traffic.

Do I still need encrypted DNS with a VPN?
Usually the VPN already carries your DNS inside the tunnel. Check which resolver is actually being used, because a browser setting can send lookups elsewhere.

Is changing the port enough to keep my resolver private?
No. Scanners find services on unusual ports. Restrict who can connect with a VPN, a firewall and the resolver's own access rules.

Related guides

Ready to try it? Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works