What Is a DNS Leak?
A DNS leak happens when your device asks for website addresses outside the VPN tunnel. Here is why it happens, how to test for it, and what to do about it.
10 min readUpdated Oct 15, 2026By XPASS Editorial Team

Every time you type a website name, your device first has to find out which address belongs to it. That lookup is called a DNS query. When you use a VPN, those queries should travel through the encrypted tunnel with the rest of your traffic. A DNS leak is when they do not: the lookups go out the normal way, and whoever runs that path can see which sites you are asking about. People search for this problem as a "VPN DNS leak", and the cause is almost always a setting or a network change rather than a flaw in encryption. This guide explains the causes, adds a related risk called DNS hijacking, gives a step-by-step test, and lists fixes for Windows, macOS and Linux.
A quick refresher on DNS
DNS, the Domain Name System, works like a phone book for the internet. Computers connect using numeric addresses, but people use names such as example.com. When you open a name, your device asks a DNS server to translate it into an address. The system is described in RFC 1034 and RFC 1035, and the how DNS works article walks through the steps in plain language.
By default, your device uses the DNS server given to it by the network, which is usually run by your internet provider or the network owner. Traditional DNS queries are not encrypted, so anyone on the path can read them.

What a DNS leak looks like
Here are two situations side by side.
| Without a leak | With a leak | |
|---|---|---|
| Web traffic | Goes through the VPN tunnel | Goes through the VPN tunnel |
| DNS queries | Go through the tunnel to a DNS server chosen by the VPN | Go outside the tunnel to your internet provider's or network's DNS server |
| What your internet provider sees | An encrypted connection to the VPN server | The same, plus a list of the site names you look up |
The page content is still protected inside the tunnel, so a DNS leak does not hand over your passwords or messages. What leaks is metadata: a record that this connection looked up examplebank.com and examplenews.com at these times. For many people that is exactly the information they hoped the VPN would shield.
A concrete example
Mia is in a hotel and connects to a VPN. She opens a travel forum. Her browser first asks, "What is the address of this forum?" If that question goes through the VPN tunnel, the hotel network sees nothing but encrypted traffic. If the question leaks out and goes to the hotel's DNS server, the hotel network can log that Mia looked up that forum, even though the pages themselves loaded through the VPN.
Why DNS leaks happen
- The operating system uses more than one DNS server. Some systems send queries to several servers at once or to the fastest one that answers, which can include a server outside the tunnel.
- Custom DNS settings. If you or an app configured a fixed DNS server on the device or router, the VPN may not override it.
- Network changes. Switching between Wi-Fi and mobile data can reset which DNS servers are used.
- IPv6 handling. If the VPN only handles IPv4 (RFC 8200 describes IPv6) and the network offers IPv6, some queries may bypass the tunnel.
- Browser-level DNS. Some browsers can use encrypted DNS over HTTPS (RFC 8484) with their own chosen server. That can protect the query from the local network, but it also means the lookup does not follow the VPN's DNS setup.
- Apps excluded from the tunnel. If you set some apps to bypass the VPN, their lookups follow.
- Unstable connections. If the VPN drops and reconnects, queries can go out in the gap.
A leak is usually a configuration problem rather than someone attacking you. That is good news, because configuration is fixable.
DNS hijacking: when someone else answers your lookups
A DNS leak and DNS hijacking are related but different. In a leak, your lookups travel to the wrong place, usually by accident. In DNS hijacking, the answers are tampered with or the lookups are redirected on purpose, so that a name such as examplebank.com resolves to an address chosen by someone else. Traditional DNS has no built-in way to prove that an answer is genuine, which is part of why encrypted options such as DNS over HTTPS (RFC 8484) and DNS over TLS (RFC 7858) exist.
Common ways hijacking happens:
- A tampered router. Malware or a weak router password can change the DNS server your whole home network uses.
- Malware on the device. Some malicious software changes the device's DNS settings or its hosts file.
- Hostile or careless networks. An open Wi-Fi hotspot can hand out its own DNS server and return false answers for chosen sites.
- Redirecting pages. Some networks answer lookups for non-existent names with an advertising page.
How it relates to your VPN: when the tunnel is working and the VPN supplies the DNS server, your lookups skip the local network's resolver, which removes the easiest hijacking path on a café or hotel network. If a leak sends lookups back to the local resolver, that protection disappears. A VPN does not repair an infected device or a compromised router, though. Signs to watch for include sites that suddenly show certificate warnings, pages that redirect to unfamiliar addresses, or a DNS server in your settings that you never chose. Treat certificate warnings seriously and never click through them on a banking or email page. If you suspect hijacking, check your router and device DNS settings, change the router's admin password, update its firmware and run a security scan.
How to test for a DNS leak, step by step
A good test compares three readings: before the VPN, with the VPN, and after a disruption. Take your time with the first one, because everything depends on it.
- Close other VPNs and proxies. Only one tool should be handling your traffic during the test.
- Take the baseline without the VPN. Disconnect the VPN and run a DNS leak test from any reputable testing site, using the extended or full option if there is one. Write down the DNS servers and the provider names shown. These are your normal resolvers, usually belonging to your internet provider or your router.
- Connect the VPN and wait until the app shows it as connected. Then reload the test page, or open it in a fresh private window, so the old result is not cached.
- Run the test again and compare. The servers listed should differ from the baseline and should not belong to your normal internet provider. Seeing the VPN's own resolvers, or a public resolver the VPN is documented to use, is expected.
- Run it in two browsers. Browsers can behave differently, especially when one has its own secure DNS setting.
- Disrupt and retest. Turn Wi-Fi off and on, or switch from Wi-Fi to mobile data, wait for the VPN to reconnect and run the test once more. Leaks often appear only after a network change.
- Repeat on other networks you regularly use, such as mobile data or a workplace Wi-Fi where you are allowed to use a VPN.
- Write the results down, with the date, network and app version, so you can compare after future updates.
How to read the result:
| What you see | Likely meaning |
|---|---|
| Only the VPN's resolvers | No leak found in this test |
| Your internet provider's resolvers appear alongside the VPN's | Probable leak; some queries bypass the tunnel |
| Only your internet provider's resolvers | The queries are not using the VPN at all; check that the tunnel is really connected |
| A public resolver you did not expect | Possibly a browser or device setting; check where it came from before concluding it is a leak |
If the results after connecting still show your provider's DNS servers, you probably have a leak. The help guide on checking whether your VPN is working includes this test among others. A related issue, WebRTC leaks, can expose your real IP address through the browser and is tested separately.
How to fix a DNS leak
Work through these in order and test again after each change.
- Reconnect the VPN. Disconnect, wait a few seconds, connect again, and re-run the test.
- Update the app and the operating system. Many leaks are fixed in updates.
- Check for excluded apps. If you have apps set to bypass the VPN, remove the exclusion or test without them.
- Review custom DNS settings. If your device or router has a manually set DNS server, set it back to automatic so the VPN can supply its own.
- Check your browser's DNS setting. If you turned on a browser's own secure DNS option, try turning it off for the test and compare.
- Switch networks and retest. Try mobile data to see whether the issue is tied to one Wi-Fi network.
- Try another connection method if the app lets you choose one. The My Pass page of your account lists the supported methods.
- Contact support. If the leak persists, tell your provider what the test showed.
Do not turn off security features, such as a firewall, just to make a test pass.

Fixing a DNS leak on Windows, macOS and Linux
Work through the general steps first. If the leak remains, these operating-system notes cover the most common causes. Only change settings on a device you own or administer. On a managed work or school device, ask the administrator instead.
Windows
- See what the PC is using. Open Command Prompt and run
ipconfig /all. Look at the "DNS Servers" line for each network adapter, including the VPN adapter. - Set DNS back to automatic. In Settings, open Network and internet, choose your Wi-Fi or Ethernet connection, and edit the DNS server assignment. Leave it on Automatic unless you have a reason to use a fixed server.
- Know about multi-homed name resolution. Windows can send a lookup to several network adapters at once and use the first answer, which means a query can go out through the normal adapter as well as the VPN. This behaviour is why Windows is a frequent place for a Windows VPN DNS leak. Some VPN apps work around it, and administrators can change a related policy on managed machines, but on a personal PC the practical fix is to update the VPN app and keep its leak protection options switched on if it has them.
- Clear the cache after changes with
ipconfig /flushdns, then reconnect. - Check the browser. Chrome, Edge and Firefox can use their own secure DNS provider. Turn it off for the test, or set it to use the system's DNS.
macOS
- See what the Mac is using. In Terminal, run
scutil --dns. Several resolvers listed in order tell you where lookups can go. With the VPN connected, the VPN's resolver should appear first. - Review the DNS settings. In System Settings, open Network, choose your connection, open Details and then DNS. If you added servers manually, remove them or move the VPN's servers to the top.
- Check for profiles and filters. A DNS profile, security software or a content filter can override the VPN's DNS. Pause or adjust it while testing, and re-enable it afterwards.
- Clear the cache with
sudo dscacheutil -flushcachefollowed bysudo killall -HUP mDNSResponder, then reconnect. A Mac VPN DNS leak is often traced to a manual DNS entry left over from an earlier setup. - Check the browser's secure DNS option, as on Windows.
Linux
- See what the system is using. On systems with systemd-resolved,
resolvectl statuslists the DNS servers per interface. Check that the VPN interface has the DNS servers and that the normal interface is not also answering general lookups. - Check NetworkManager. If your VPN connection is managed there, open the connection's IPv4 and IPv6 settings and check the DNS and "ignore automatically obtained DNS" options. Leaving IPv6 unhandled is a classic leak path.
- Watch for local resolvers. Some distributions run a local caching resolver. It can forward queries outside the tunnel if it is not told to use the VPN's DNS.
- Clear the cache with
resolvectl flush-caches, then reconnect.
On all three systems, an IPv6 setting that is not covered by the VPN is a frequent cause, so retest with IPv6 on and off if you can.
Limits and what to watch for
- A clean test result on one day and one network is a snapshot, not a guarantee. Retest after changes such as an operating system update, a new router or a different network.
- Test websites differ, and some are better than others. Use more than one if you are not sure of a result.
- Fixing a DNS leak does not make you anonymous. Cookies, accounts and fingerprints still identify you; see can a VPN make you anonymous for that wider picture.
- Some VPN tools offer a kill switch, which blocks traffic when the VPN drops. If your app has one, it can prevent leaks during reconnections.
- Network-level DNS filtering at work or school is a separate setup. Do not try to change settings on a managed device without permission.
Summary
A DNS leak means your website lookups go outside the VPN tunnel, so your internet provider or local network can see which sites you visit even though the page content is protected. Causes are mostly configuration: multiple DNS servers, custom settings, IPv6, browser DNS, excluded apps or unstable connections. Test with and without the VPN, fix settings one step at a time, and retest whenever your setup changes.
If you want to check your own connection, the Help Center has step-by-step guides, and a prepaid XPASS pass gives you a fixed period to try it with no automatic renewal.
Frequently asked questions
What is a DNS leak?
A DNS leak is when your device sends its DNS queries, the lookups that turn website names into addresses, outside the VPN tunnel to your normal internet provider's DNS servers. The page content may still be protected, but the list of sites you look up becomes visible.
How do I test for a DNS leak?
Connect to your VPN, then open a DNS leak test from any reputable testing site and run it. If the DNS servers listed belong to your normal internet provider or local network rather than the VPN, you likely have a leak.
Does a DNS leak expose my passwords or messages?
No. A DNS leak exposes which website names your device looks up, not the content of pages, passwords or messages. It is still a privacy problem because it shows your browsing pattern to whoever sees those queries.
How do I fix a DNS leak?
Reconnect the VPN and test again, update the VPN app, check that no apps are excluded from the tunnel, and review any custom DNS settings on your device or router. If it still leaks, contact your VPN provider's support.
What is DNS hijacking and is it the same as a DNS leak?
No. A DNS leak sends your lookups to the wrong place by accident, usually through a settings problem. DNS hijacking is when something changes the answers or redirects the lookups, for example malware or a tampered router. A VPN with a working tunnel can reduce exposure to hijacking on the local network but does not clean an infected device.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need a VPN for a short trip or a busy month?
XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.
See passesKeep reading

VPN Basics
How DNS Works: From Domain Name to IP Address
DNS is the lookup system that turns a website name into the IP address your device actually connects to. Here is how a lookup works, step by step, and why it matters for privacy.
9 min read

VPN Security
What Is a WebRTC Leak?
WebRTC lets browsers handle calls and video, but it can also reveal IP addresses a VPN was meant to hide. Here is how the leak works and what to do about it.
9 min read

Troubleshooting
How to Check If Your VPN Is Working
A VPN can show as connected and still not be doing its job. Use these checks to confirm your traffic is going through it, and fix an IP that will not change.
7 min read