← Glossary

What Is DNS Leak Protection?

DNS leak protection is any configuration that forces a device's name lookups to travel through the intended path, usually a VPN tunnel or proxy, rather than the default resolver of the local network. It is a routing policy, and encrypting DNS does not by itself provide it.

Updated:

DNS leak protection is the set of settings and mechanisms that keep domain name lookups within the resolver and routing policy intended for the connection. When a device routes web traffic through a VPN tunnel or a proxy but still sends its DNS queries to the resolver supplied by the local network, an observer at that resolver, typically the internet service provider or the operator of the Wi-Fi, can learn the queried names despite the protected application connection. Queries are not a complete browsing history: caches suppress some lookups, while prefetching can resolve names never visited. That exposure is the leak, and protection means closing the path that causes it: directing queries into the tunnel, to the proxy, or to a resolver the user has chosen, and preventing the operating system or browser from falling back to anything else. It is distinct from testing for leaks, which measures where queries actually go, and from encrypted DNS, which changes how a query is carried but not necessarily where.

How DNS Queries Are Routed

A name lookup starts in whichever component needs an address. The operating system's resolver is the usual path: applications ask it, it consults a list of DNS servers obtained from the network through DHCP or set manually, and it sends the query over UDP or TCP to one of them. Browsers increasingly have their own path. Firefox and Chromium-based browsers can send queries over DNS over HTTPS directly to a configured resolver, bypassing the operating system entirely for the browser's own lookups. Proxies add a third path: a SOCKS5 proxy accepts a domain name in its CONNECT request, so the proxy performs the lookup on the client's behalf, whereas an HTTP CONNECT request also names the host and the proxy resolves it.

A VPN tunnel captures traffic based on routing rules and, on most platforms, replaces or supplements the system's DNS servers with the VPN provider's. Leaks arise in the gaps: a second network interface with its own DNS servers, an operating-system feature that queries all interfaces in parallel, a browser whose DNS over HTTPS resolver sits outside the tunnel policy, an application that bypasses the proxy for its lookups, or a tunnel that drops momentarily while the system falls back to the local resolver. Preventing DNS leaks means identifying each of those paths and constraining it.

System, Browser and Tunnel Policies

LayerWhat decides where queries goProtection measure
Operating systemInterface DNS settings, resolver priority, multi-interface behaviourApply the intended per-interface or split-DNS policy; where appropriate, block conventional DNS outside authorised routes
VPN clientRouting rules and DNS push from the serverClient option to enforce tunnel DNS and block queries elsewhere, including during reconnection
BrowserBuilt-in DNS over HTTPS settings and fallback behaviourChoose a resolver reachable through the tunnel, or a mode that never falls back to the system resolver when strict routing is required
Proxy configurationWhether the application resolves names locally or hands them to the proxyPass domain names to the proxy when remote resolution is intended; separately check local bootstrap and background lookups
ApplicationsPer-app proxy and network settingsVerify that each application honours the system or proxy configuration rather than making its own lookups

Browser behaviour deserves attention because it is configurable and widely misunderstood. Firefox's resolver documentation describes modes in which DNS over HTTPS is tried first with fallback to the native resolver, and a stricter mode with no fallback, together with heuristics that fall back to the system resolver when the DoH server is unreachable, when a lookup returns no such domain, or when no answer arrives within a short interval, and it excludes certain names such as local domains and the network's DNS suffix. Chromium documents an automatic upgrade mode intended to preserve the existing provider where a supported DoH equivalent is known. Explicit secure-DNS settings and managed policies can select different behaviour. In each case the browser's DNS routing policy can differ from the operating system's, and a VPN DNS configuration that only sets system resolvers does not govern a browser whose DoH resolver is reached outside the tunnel.

Protection Compared With Testing and Encrypted DNS

Three ideas are often conflated.

  • Protection is the policy: queries must go through the intended path and nowhere else.
  • Testing is measurement: a test page causes the browser to resolve unique hostnames and reports which resolvers asked for them, revealing whether the policy holds in practice.
  • Encrypted DNS is transport: DNS over HTTPS, defined in RFC 8484, carries queries inside HTTPS so that on-path devices cannot read or alter them, and the RFC notes it requires authentication of the server.

Encryption solves a different problem from routing. A public DoH resolver can be reached through a VPN tunnel or directly outside it; the provider's identity alone does not reveal the route. If a query actually bypasses the tunnel, encryption protects its DNS contents from ordinary local observers, while the resolver receives the queried name and connection metadata. Whether that counts as a leak depends on the threat model: if the goal is to hide lookups from the local network, encrypted DNS achieves it; if the goal is to prevent any DNS connection outside the tunnel, a direct DoH connection still violates that route policy. Recursive and authoritative DNS services can also observe parts of resolution, so tunnel routing is not a promise that only one provider ever learns a name. The RFC itself observes that the DoH server can return invalid data in the absence of DNSSEC, so choosing the resolver is a trust decision in its own right. Protection is complete only when both the destination and the path of queries are those the user intended, and verification must cover both. A web leak test reports resolver egress for its own queries; checking the actual client route may also require network logs or packet capture.

Where DNS Leak Protection Matters

Anyone using a VPN to hide browsing from a local network or ISP depends on it, since a leak reveals the destinations that the tunnel was meant to conceal. Users testing regional content through a proxy should check where resolution occurs, because resolver location or client-subnet information can affect returned addresses. A resolver need not be in the same region to be valid; the desired routing policy determines whether a mismatch matters. Corporate split-tunnel configurations need the opposite discipline, sending internal names to internal resolvers and nothing else, which is a routing policy of the same kind. Testers of geo-targeted content, researchers and journalists all have reasons to verify that lookups go where the rest of their traffic goes.

Limits and Why Testing Must Be Repeated

Protection is a configuration, and configurations drift. Joining a new Wi-Fi network supplies new DNS servers; a system update can reset resolver settings or enable a new multi-interface behaviour; a browser update can change DoH defaults; a VPN client reconnecting after sleep can briefly expose the system resolver; and an application installed later may ignore proxy settings. Each of these events can reopen a path that was closed, which is why protection should be tested after network changes rather than assumed from a one-time setup. Protection also covers only name resolution. It does not hide the IP addresses the device subsequently connects to from the local network, which still sees the tunnel endpoint or proxy address, and it does not address other disclosure paths such as WebRTC or destination names visible in an unencrypted proxy handshake. DNS leak protection keeps one specific signal, the list of names a device looks up, on the path the user chose, and it has to be maintained to keep doing so.

Frequently asked questions

Does encrypted DNS automatically prevent leaks?

No. Encryption protects query contents in transit, while routing determines where the connection goes. A public DoH resolver may be reached inside or outside a VPN tunnel. Check the actual route and trusted resolver rather than treating provider identity as proof of a leak.

Can browser DNS settings differ from the operating system?

Yes. Firefox and Chromium-based browsers can resolve names through their own DNS over HTTPS resolver, with their own fallback rules, independently of the system's DNS servers. A VPN that only changes system resolvers does not govern that browser path.

Why should protection be tested after network changes?

Network settings, VPN reconnections, application routing and browser DNS policies can change. A browser leak test reveals resolvers handling its test queries, but not every application or the complete client route. Verify those separately where the threat model requires it.

How does a SOCKS5 proxy affect DNS leaks?

Passing a domain name lets the SOCKS5 proxy resolve it instead of requiring a local lookup for that destination. The client may still perform other lookups, and SOCKS alone does not encrypt the hostname in its handshake. Check resolution mode and transport protection separately.

Does DNS leak protection hide which sites I connect to from my ISP?

It can prevent unintended DNS disclosure to the ISP, depending on the configured route and transport. The ISP still sees the tunnel endpoint, and other metadata or traffic outside the tunnel can reveal more. DNS protection does not by itself make browsing destinations unobservable.