Skip to content
$ learn dns-leak

What is a DNS leak and how to test for it

How DNS leaks happen, how to test for one, and how to fix it.

A VPN or proxy can hide your IP address and still reveal where you browse, if your DNS queries go somewhere else. That is a DNS leak. This guide explains how it happens, how SOCKS5 and socks5h differ, what operating systems and browsers do on their own, and how to test. One honest note up front: proxychecker.org does not offer a dedicated DNS leak test, and this article says so where it matters.

What a DNS leak is

Before connecting to example.com, your device asks a DNS resolver for its IP address. Normally that resolver belongs to your ISP or router. When you turn on a VPN or proxy, you expect everything, including those lookups, to travel through the tunnel to the provider's resolver. A DNS leak happens when the lookups still go to your ISP's resolver (or another resolver outside the tunnel).

The result: the website sees the proxy's IP, but your ISP can still see the list of domain names you resolve. It does not see page contents over HTTPS, but domain names alone are revealing. A leak can also let a local network redirect or censor lookups.

How leaks happen

SOCKS5 vs socks5h: who resolves the name

With SOCKS5, the client can send either an IP address or a hostname in the connection request. Tools expose this as two URL schemes:

SchemeDNS resolved byLeak risk
socks5://Your machine, before contacting the proxyYes, queries use your normal resolver
socks5h://The proxy server (the "h" means hostname)No local lookup for the target name
# local DNS lookup, then the IP goes to the proxy
curl -x socks5://203.0.113.10:1080 https://example.com

# hostname passed to the proxy, which resolves it
curl -x socks5h://203.0.113.10:1080 https://example.com

This h suffix is a convention of curl and libraries built on similar code, such as Python requests with the socks extra. Other clients name the setting differently, for example "proxy DNS when using SOCKS" in Firefox. HTTP proxies using CONNECT normally receive the hostname, so the proxy resolves it. Plain socks5:// is a common source of unintentional leaks; see using a proxy with curl, Python and Node.js for working syntax.

DoH and DoT

DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt queries between your device and a resolver, so someone on the network path cannot read them. They solve a different problem from leaks. Encryption hides the content from your ISP, but the chosen resolver still sees every name. If a browser silently sends DoH to a third-party resolver while your VPN assumes its own DNS, you have a leak of a different kind: the queries are encrypted but go outside the tunnel to a party you did not pick.

Whether DoH is enabled by default depends on the browser, version and region. Check the setting explicitly rather than relying on defaults.

Browser settings to review

How to test for a DNS leak

Testing a DNS leak needs a service that can tell which resolver reached it. Typically a test page makes your browser look up unique random hostnames under a domain whose name server logs the incoming queries, then shows you the IPs of the resolvers that asked. If those belong to your ISP while your VPN is on, you are leaking.

Our site does not provide this kind of test. The tools we do have cover related parts:

For a DNS leak test, use a dedicated service from a provider you trust, and run it with your VPN or proxy active.

A manual check from the command line

You can also inspect what your system is configured to use. On Linux with systemd-resolved, resolvectl status lists resolvers per interface. On macOS, scutil --dns shows resolvers in priority order. On Windows, ipconfig /all lists DNS servers per adapter. With the VPN connected, resolvers on the tunnel interface should be the ones in use; resolvers from your home router or ISP appearing first are a warning sign. The output formats vary between versions.

How to fix a leak

  1. Use socks5h or the equivalent remote-DNS option wherever you use SOCKS5.
  2. In your VPN client, enable its DNS leak protection or kill switch if offered, and set it to use the provider's DNS.
  3. Disable IPv6 on the interface, or choose a VPN that tunnels it, if you see IPv6 queries leaving.
  4. Set browser DNS (DoH) explicitly instead of letting it default.
  5. Re-run a leak test after each change.

A leak test measures one moment on one setup. Repeat it after network changes, sleep and wake cycles, and VPN reconnects.

Published and last updated 2026-12-02