Network security

How to Fix a DNS Leak: Test, Find and Stop Leaks in Minutes

Your VPN can be connected and still leak every domain you visit. Here is how to test for a DNS leak, read the results, and fix the cause on any device.

Cysoro Security TeamPublished · 11 min read
NETWORK SECURITY Fix a DNS leak fast Test it, find the cause, seal the tunnel. CYSORO.COM dnsleaktest.com ISP resolver detected 203.0.113.14 — leaking VPN resolver only — sealed !
Quick answer

To fix a DNS leak, first confirm it with a leak test such as dnsleaktest.com, then make every lookup travel inside the VPN tunnel: enable the VPN's DNS leak protection and kill switch, turn off split tunneling for the apps you test, align browser DNS-over-HTTPS with the VPN, and fix IPv6 by routing it through the tunnel or disabling it. Re-test after each change until only the VPN provider's resolvers appear.

Key takeaways

  • A DNS leak means your lookups go to your ISP or router instead of through the VPN tunnel, exposing the domains you visit.
  • Test with a baseline first: run a leak test with the VPN off, then on, and compare which resolvers answer.
  • Most leaks are fixed by the VPN's own DNS setting, turning off split tunneling, or aligning the browser's DNS-over-HTTPS setting.

You connect your VPN, the icon turns green, and you assume you are private. Then a leak test shows your internet provider's DNS servers answering your lookups. That is a DNS leak — and it is one of the most common VPN privacy failures.

What is a DNS leak?

A DNS leak happens when your device sends domain-name lookups to a resolver outside your VPN tunnel, usually your ISP's resolver or your router's, even though your web traffic travels through the VPN.

DNS is the system that turns a name like example.com into an IP address your browser can connect to. As Cloudflare explains, a recursive resolver receives your query and tracks down the answer through root, top-level-domain and authoritative nameservers. Whoever runs the resolver you use can see every domain you look up.

With a VPN working correctly, your lookups travel inside the encrypted tunnel to the VPN provider's resolver. With a leak, some or all of them take a different path. Your browsing content stays encrypted, but the list of domains you visit is visible — which is often enough to profile you.

How do I test for a DNS leak?

Run a dedicated leak test twice: once with the VPN off to record your baseline, then again with the VPN on, and compare the resolvers that answer.

A browser cannot ask your operating system which resolver it uses, so leak tests work from the other side. The test page makes your browser look up a set of unique hostnames that have never been queried before, under a domain whose authoritative server is run by the tester. Whichever resolver asks about those names is the one your system actually used.

  1. Disconnect the VPN. Open dnsleaktest.com and note the IP address, ISP name and DNS servers shown. This is your baseline.
  2. Connect the VPN fully. Pick a server, wait for the app to report the tunnel is active, and turn split tunneling off while you diagnose.
  3. Close and reopen your browser. This drops cached lookups and old connections that could pollute the result.
  4. Run the extended test. The standard test checks a few queries; the extended test runs more and is harder to fool.
  5. Compare. If the only resolvers listed belong to your VPN provider or its chosen DNS service, you are clean. If your ISP, your router's address, or any resolver from your baseline appears, you have a leak.

Also test from the command line, because the browser and the operating system can use different resolvers. On macOS or Linux, run dig +short TXT whoami.ds.akahelp.net; on Windows, run nslookup -type=TXT whoami.ds.akahelp.net. The answer names the recursive resolver that asked for it.

How do I read DNS leak test results?

A clean result shows only resolvers operated by your VPN provider or the DNS service it uses. Anything matching your baseline means a leak.

What the test showsWhat it meansWhat to do
Only VPN provider resolversNo DNS leakNothing to fix; re-test after reconnecting
Your ISP's resolvers appearDNS leakApply the VPN and system fixes below
Your router's IP (e.g. 192.168.1.1)Local resolver leakChange the system or router DNS settings
Your real IPv6 addressIPv6 leakRoute IPv6 through the VPN or disable it
Your real IP in the WebRTC sectionWebRTC leak, not DNSUse a full-tunnel VPN, not a browser extension
Different results each runMultiple resolvers in playCheck for extra network interfaces and fallback settings

Do not panic over a resolver you do not recognize by name alone. Look up its IP address to see who operates it: some VPN providers rent resolver capacity from third parties, and the name on the test may be the infrastructure owner rather than the VPN brand. What matters is that no resolver from your baseline appears.

What causes a DNS leak?

Most leaks come from configuration, not from a broken VPN service. The usual causes are a VPN client that does not manage DNS, a browser resolving on its own, split tunneling, several active networks, IPv6 bypassing the tunnel, or a fallback to a backup resolver.

Where your DNS queries actually go Your device browser, apps, OS ISP resolver sees every domain VPN resolver inside the tunnel LEAK — outside the tunnel CORRECT — inside the encrypted tunnel
A leak sends lookups to your ISP in plain sight; a working VPN sends them through the tunnel. Illustration by Cysoro.

The VPN app is not managing DNS

Some clients, especially manual setups and split-tunnel configurations, route traffic through the tunnel but leave the system's DNS settings untouched. The operating system then keeps using the resolver it got from DHCP — usually your router or ISP.

The browser resolves on its own

A browser with DNS over HTTPS enabled sends its lookups to the DoH provider it was configured with, bypassing the system resolver — and the VPN's DNS with it. Mozilla notes that DoH bypasses the local DNS resolver by design, which is good for privacy on an open network but defeats a VPN's DNS handling when the two disagree.

Split tunneling is on

Split tunneling intentionally sends selected apps or destinations outside the VPN. If your browser is excluded, its DNS lookups go out on the normal connection too. This is not a bug; it is the feature working as configured. Turn it off while diagnosing.

IPv6 goes around an IPv4-only VPN

If the VPN handles IPv4 but not IPv6, IPv6-capable lookups can leave through the physical connection. This is one of the most common leaks, because the user sees a working VPN while a whole protocol bypasses it.

A fallback after a slow answer

If the VPN's resolver is slow or unreachable for a moment, the operating system may fall back to the DHCP-provided resolver. Windows can also query several interfaces in parallel through Smart Multi-Homed Name Resolution, which has existed since Windows 8.

How do I fix a DNS leak in my VPN settings?

Start inside the VPN app: update it, enable its DNS leak protection and kill switch, turn off split tunneling, and reconnect. That alone fixes most leaks.

  1. Update the VPN client. DNS handling bugs get fixed in updates, and older clients are a common cause of leaks.
  2. Enable DNS leak protection. Most reputable VPN apps have a setting with this name. It forces the system to use the VPN's resolver and blocks queries to any other resolver while connected.
  3. Enable the kill switch. If the tunnel drops, a kill switch blocks all traffic instead of letting it fall back to the normal connection — which is exactly when leaks happen.
  4. Turn off split tunneling. Re-test with every app inside the tunnel. If the leak disappears, re-enable split tunneling selectively and re-test each exclusion.
  5. Check for a custom DNS setting in the app. Some apps let you pick a resolver. If you previously set one manually, clear it or set it to the VPN's default.
  6. Reconnect and re-test. Change one thing at a time and run the extended test after each change, so you know which setting fixed it.

If the leak persists with all of these on, the problem is outside the app: the operating system, the browser, or the router. Work through the next sections in order.

How do I fix a DNS leak on Windows and macOS?

On both systems, the fix is to remove the manual or DHCP-provided resolver that competes with the VPN, then make sure only one network path is active.

Windows

Open Settings, then Network and Internet, and check every adapter — Wi-Fi, Ethernet, and any virtual adapters. If an adapter has a manual DNS server set, remove it or set it to automatic while the VPN is connected. Windows queries more than one adapter, so a forgotten Ethernet adapter with a manual DNS entry can leak even while Wi-Fi goes through the VPN.

If you use OpenVPN, the block-outside-dns option in the client configuration blocks leaks aggressively on Windows. For WireGuard, make sure the profile lists both 0.0.0.0/0 and ::/0 under AllowedIPs, so IPv6 traffic enters the tunnel too.

macOS

Open System Settings, then Network, and inspect the DNS tab of each active service. Remove any manual servers that are not the VPN's. If the leak continues, disconnect other interfaces — a Mac connected to both Wi-Fi and Ethernet, or to a phone hotspot, can send queries over the wrong one.

On macOS, the fix for IPv6 is to set Configure IPv6 to Link-local only for the active interface while using the VPN. That stops IPv6 lookups from leaving outside the tunnel.

How do I fix a DNS leak in my browser?

Align the browser's DNS setting with the VPN: either turn DNS over HTTPS off so the browser uses the system resolver inside the tunnel, or point it at the same resolver the VPN uses.

In Chrome, open Settings, then Privacy and security, then Security, and look for "Use secure DNS". If it is on with a custom provider, that provider receives your lookups directly — encrypted, but outside the VPN's resolver. Either switch it to "With your current service provider" or turn it off while the VPN is connected.

In Firefox, open Settings, then Privacy and Security, and scroll to DNS over HTTPS. Mozilla's support pages explain that Firefox can fall back to the operating system's resolver if DoH fails, which is another way a leak appears. Choose "Off" to let the VPN handle DNS, or set a custom provider that matches the one your VPN uses.

After changing the setting, restart the browser before re-testing. Browsers cache DNS answers, and a stale cache can make a fixed leak look like it is still there. Our free WebRTC leak test checks a related problem — your real IP address leaking through the browser — in the same session.

How do I fix an IPv6 DNS leak?

First check whether your VPN routes IPv6. If it does, make sure that is enabled in the app. If it does not, either switch to a VPN that handles IPv6 or disable IPv6 on the device while the VPN is connected.

On Windows, open the properties of your Wi-Fi or Ethernet adapter and clear the Internet Protocol Version 6 checkbox. On macOS, set Configure IPv6 to Link-local only. On Linux, you can disable IPv6 with sysctl, but prefer a VPN profile that includes ::/0 in its allowed addresses — that keeps IPv6 working inside the tunnel instead of removing it.

Disabling IPv6 is a workaround, not a fix. A VPN that ignores IPv6 is leaving a whole protocol unprotected, and the same gap can leak more than DNS. If your provider has no IPv6 support and no plan to add it, that is a reason to switch providers.

What about Linux, Android, iOS and routers?

On Linux, the resolver layer is often systemd-resolved, which keeps per-link DNS settings and may keep using the original interface's DNS even when traffic is routed elsewhere. Check resolvectl status to see which resolver each link uses, and set the VPN link's DNS explicitly. For WireGuard, the DNS = line in the interface section tells the client to point the system resolver at a server reachable only through the tunnel.

On Android, use the VPN app's own DNS setting rather than Android's Private DNS feature, which can send queries to a provider outside the tunnel. If you use Private DNS, set it to the same hostname your VPN uses, or turn it off while the VPN is connected.

On iOS, VPN apps manage DNS through the system VPN configuration. If a leak appears, remove any manual DNS profile or configuration profile that sets a resolver, then reconnect. iOS does not expose per-interface DNS controls the way desktop systems do, so the VPN app is the main control point.

On a router, the fix is to set the router's DNS to a resolver you trust — or to the VPN provider's resolver if the router itself runs the VPN. Google documents its public resolver at 8.8.8.8 and 8.8.4.4, and Cloudflare's is 1.1.1.1. Changing the router fixes every device behind it at once.

Remember that the router's resolver sees your lookups when the VPN is off, so choose one you trust rather than leaving the ISP default in place.

How do I prevent DNS leaks in the future?

Prevention is a short routine: keep the VPN updated, keep its leak protection and kill switch on, and re-test after every change to your setup.

Five habits that keep DNS inside the tunnel 1. Keep the VPN app updated — DNS handling bugs are fixed in updates 2. Leave DNS leak protection and the kill switch switched on 3. Re-test after every change: new network, new browser, new VPN server 4. Use one resolver everywhere — VPN, system and browser must agree 5. Check IPv6 handling before you trust a new VPN provider
A short routine prevents most leaks before they happen. Illustration by Cysoro.
  • Re-test after changes. A new Wi-Fi network, a browser update, a VPN server change or a new device can all reintroduce a leak. Run the extended test monthly and after any network change.
  • Use one resolver everywhere. The VPN, the operating system and the browser should all point at the same resolver. Three different resolvers means three chances to leak.
  • Prefer a VPN with IPv6 support. Ask before you buy whether the provider routes IPv6 through the tunnel or blocks it. A provider that ignores the question is a warning sign.
  • Watch the kill switch. Some apps turn it off after an update. Verify it is still on after every app update.
  • Use encrypted DNS when the VPN is off. DNS over HTTPS or DNS over TLS to a resolver you trust stops your ISP from reading lookups on networks where you are not using a VPN.

If you want a quick check of your own setup, our free DNS lookup tool shows what your current resolver returns for any domain.

You can also confirm what the outside world sees with the what-is-my-IP tool, which shows the address and network your traffic appears to come from.

The bottom line

A DNS leak is usually a settings problem, not a broken VPN. Test with a baseline, fix the VPN app first, then the browser, then IPv6 — and re-test after each change until only your VPN provider's resolvers answer.

If the leak survives all of these steps, the cause is usually a second VPN client, a security product with its own DNS filtering, or a managed device policy. Remove the extra software one piece at a time and re-test. And if your provider cannot stop the leak at all, that is your answer about the provider. Check your setup now with the free DNS lookup tool.

Frequently asked questions

What is a DNS leak?

A DNS leak happens when your device sends domain-name lookups to a resolver outside your VPN tunnel, usually your ISP's resolver or your router's. Your traffic is still encrypted, but the names of the sites you visit are visible to whoever runs that resolver.

How do I test for a DNS leak?

Run a leak test such as dnsleaktest.com first with the VPN disconnected to record your baseline, then connect the VPN and run the extended test again. If any resolver from your ISP or home network appears while the VPN is on, you have a leak.

Does a DNS leak expose my browsing history?

No, it does not expose the full pages you visited or the content of your traffic. It exposes the domain names you looked up, which is still a detailed picture of your browsing, including the sites and services you use.

Why does my VPN leak DNS on Windows?

The most common Windows cause is Smart Multi-Homed Name Resolution, which can send queries out of several network interfaces at once. Other causes are split tunneling, a browser with its own DNS-over-HTTPS setting, and IPv6 traffic bypassing an IPv4-only tunnel.

Should I disable IPv6 to stop a DNS leak?

Only as a last resort. The better fix is a VPN that routes IPv6 through the tunnel or blocks it cleanly. Disabling IPv6 on the device also works, but it removes a protocol your network may need, so prefer a VPN that handles IPv6 properly.

Is DNS over HTTPS a fix for DNS leaks?

DNS over HTTPS encrypts your lookups so nobody on the local network can read them, but it does not fix a leak by itself. If the browser sends DoH queries to a provider outside your VPN, the VPN's resolver is still bypassed. Align the browser setting with the VPN instead of treating DoH as a cure.

Can a DNS leak happen without a VPN?

Yes, but the term is mainly used with VPNs. Without a VPN, your lookups normally go to your ISP's resolver by design. The privacy problem is the same, and the fix is the same: use an encrypted resolver you trust, such as DNS over HTTPS or DNS over TLS.

Sources

  1. Cloudflare — What is DNS?
  2. Mozilla Support — Firefox DNS over HTTPS
  3. Google Public DNS — Get Started
  4. DNSLeakTest — DNS leak test
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Cloudflare's DNS documentation, Mozilla's DNS-over-HTTPS support pages and Google Public DNS configuration guidance.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free