VPN DNS leak: what it is, how to test and fix it
A VPN DNS leak happens when your device sends its DNS lookups, the requests that turn a site name into an address, outside the VPN tunnel, usually to your internet provider. Your traffic goes through the VPN, but the list of sites you look up does not.
Everything still loads normally while it happens, which is why most people only find out from a leak test.
What DNS is
Every time you open a site or an app connects to a server, your device first asks for the address behind the name. That question is a DNS lookup.
The rules for this go back to RFC 1034, the document that introduced the Domain Name System. It describes resolvers as "programs that extract information from name servers in response to client requests", and says programs normally reach the DNS "through a simple procedure or OS call to a local resolver". In other words, your apps ask the operating system, and the operating system asks whichever DNS server it has been told to use.
At home, that server is usually your internet provider's, handed out by your router.
Why DNS lookups give so much away
A DNS lookup names the site you are about to visit. The IETF's own document on DNS privacy considerations puts the problem plainly: when you start an HTTPS connection, "the HTTP traffic will be encrypted, but the DNS exchange prior to it will not be."
The same document notes that DNS may take a different path from the rest of your traffic, and that the best place to watch it is between your device and the resolver answering your lookups. That resolver is exactly where a leak sends them.
So a DNS leak does not expose what you did on a site. It exposes which sites, and when. For more on what your provider can and cannot see, read can my VPN see my browsing history.
What a VPN does with DNS
When a VPN connects, it should do two things: carry your traffic through the encrypted tunnel, and point your device's DNS lookups at a resolver reached through that same tunnel. Then your internet provider sees encrypted VPN traffic and nothing else.
A leak is any case where the second part fails, and lookups go out the old way.
How a DNS leak happens
There are a few common routes.
The operating system keeps using the old resolver. Devices can know about several DNS servers at once, from Wi-Fi, mobile data, the router and the VPN. If the system keeps sending some lookups to the network's resolver instead of the VPN's, those lookups leak.
Custom DNS settings. A DNS server typed into your device, router or network settings can override the one the VPN sets.
Browser secure DNS. Many browsers can send lookups themselves using DNS over HTTPS, defined in RFC 8484 as sending DNS queries and getting responses over HTTPS. Those lookups are encrypted, but they go to whatever resolver the browser picked, not the one your VPN set, and a leak test will show that resolver.
IPv6. RFC 7359 describes how VPN software without proper IPv6 support can let traffic "leak out of such a tunnel and be sent in the clear on the local network". It adds a detail that matters for DNS: "Some systems are known to prefer IPv6-based recursive DNS servers over IPv4-based ones." If your VPN only handles IPv4, lookups can go to an IPv6 resolver on your local network.
The tunnel drops. If the VPN disconnects for a moment, the device falls back to its normal connection and its normal DNS, unless a kill switch blocks it.
DNS leaks and WebRTC leaks are different
People often mix these up. WebRTC is the browser technology behind video calls and some file sharing, and the IETF covers how it should handle addresses in RFC 8828. A WebRTC leak can reveal an IP address to a website through the browser. It has nothing to do with which DNS server answers your lookups.
A DNS leak test checks DNS. A WebRTC test checks WebRTC. You want both to pass, and fixing one does not fix the other.
How to check for a DNS leak
A DNS leak test is a web page that tells you which DNS servers are answering your lookups. The general method works like this:
- The page makes your browser look up a set of unique, made-up names under a domain the test controls.
- Your device sends those lookups to whatever resolver it is using.
- That resolver asks the test's own name servers, which record the address of the resolver that asked.
- The page lists those resolvers, usually with the company that runs each one.
To read the result, connect your VPN and run an extended test if the site offers one.
- Pass: every resolver listed belongs to your VPN provider, or to a DNS service your VPN says it uses.
- Fail: your internet provider's name appears, or the resolver of the Wi-Fi network you are on.
If you set secure DNS in your browser, expect to see that DNS service in the list. That is your browser's choice, not the VPN leaking, though it still means the VPN's resolver is not the one answering.
For the full routine, including IP, IPv6, WebRTC and kill switch checks, see how to tell if your VPN is working.
How to fix a DNS leak
Work through these in order and retest after each one.
- Update the VPN app and your operating system, then retest.
- Turn on DNS leak protection in the VPN app, if it has a setting for it, and let the VPN set its own DNS.
- Remove custom DNS. Check your device's network settings and your router for DNS servers you or someone else typed in, and set them back to automatic while you test.
- Check browser secure DNS. If your browser has its own DNS over HTTPS setting, decide whether you want it. If you want the VPN to handle all lookups, turn it off and retest.
- Deal with IPv6. If your VPN app has an IPv6 leak protection setting, turn it on. RFC 7359 lists turning off IPv6 on your network connections as a temporary workaround when VPN software does not support IPv6, with proper IPv6 handling in the VPN as the real fix.
- Turn on the kill switch, so a dropped tunnel cannot fall back to your normal DNS.
If the test still shows your internet provider after all of that, the VPN app is not handling DNS properly on your system, and it is time to try a different one.
Frequently asked questions
What does a DNS leak mean?
It means your DNS lookups are going outside the VPN tunnel, so whoever runs that DNS server, usually your internet provider, can see the names of the sites you visit even though the rest of your traffic is encrypted.
Is a DNS leak dangerous?
It undoes part of what you use a VPN for. Your provider or the network you are on can see which sites you look up. It does not reveal what you do on those sites if they use HTTPS.
Does a DNS leak show my IP address?
The test site sees the resolver's address, not necessarily yours. If that resolver belongs to your internet provider, the leak points back to your provider.
Why is my DNS leaking with a VPN on?
The usual causes are custom DNS settings on the device or router, browser secure DNS, IPv6 traffic the VPN does not carry, or a moment when the tunnel dropped without a kill switch.
What DNS server should I use with a VPN?
The one your VPN sets. Using the VPN's resolver through the tunnel keeps your lookups off your provider's servers. Changing it yourself is one of the common ways people create a leak.
Does a DNS leak test work on my phone?
Yes. Run it in your phone's browser with the VPN connected. It checks the resolver your phone is using at that moment, on Wi-Fi or mobile data.
DNS on Secria VPN
If you want to try a VPN without paying, Secria VPN Free works on iPhone, iPad, Mac and Android with a free Secria account, no card needed. Every connection is post-quantum (WireGuard with an ML-KEM-1024 key added to every session), it includes a kill switch that blocks the internet if the VPN stops, and DNS blocking that helps block ads and trackers, on Free too. Free servers are in Frankfurt and Dallas, one device at a time. Paid plans add every location, Multi-Hop, split tunneling and 5 devices.
No activity logs: we do not record browsing, DNS queries or traffic contents. See Secria VPN.
Secria fact-checks every post against primary sources. Spotted something wrong or out of date? Email hq@secria.me and we will correct it.