When you use a VPN, you expect all your traffic to pass through the encrypted tunnel, including the DNS queries that look up the names of the sites you visit. A DNS leak is when some or all of these queries leave the VPN tunnel and go to your internet provider’s DNS server instead.
When a leak happens, the VPN appears to be working, yet the domain names you look up may be visible to your internet provider. This article explains why leaks happen, how to test for them and how to prevent them. If you are not sure how a VPN differs from DNS, start with VPN vs DNS.
Why do DNS leaks happen?
- Operating system behavior: Some systems send a query to several network adapters at once and use the fastest answer.
- IPv6: If the VPN only tunnels IPv4 traffic, queries sent over IPv6 can stay outside.
- Manually set DNS: If a fixed DNS server is set on the device or router, some VPN apps do not override it.
- Dropped connections: When the VPN drops for a moment, queries go over the normal connection.
- The browser’s own DNS setting: If secure DNS is on in the browser, queries go to the server the browser has chosen, regardless of the system.
How to test for a DNS leak
- With the VPN off, open a DNS leak test site and run the “extended” or “standard” test. Note the servers listed in the result; they usually belong to your internet provider.
- Turn the VPN on and run the same test again.
- If the second test shows only servers belonging to your VPN provider, or the DNS service it uses, there is no leak.
- If your internet provider’s name or the servers from the first test still appear, you have a DNS leak.
It is a good idea to test on both Wi-Fi and mobile data, and on every device you use. Results can differ by device and network.
A DNS leak and an IP leak are different things. The WebRTC feature in browsers can reveal your real IP address; that is checked with a separate test.
How to prevent leaks
- If your VPN app has a “DNS leak protection” option or something similar, turn it on.
- Turn on the kill switch, which cuts the internet when the VPN connection drops.
- If your VPN does not support IPv6, use the app’s option to block IPv6.
- If secure DNS is on in your browser and you want it to use the VPN’s DNS, review that setting. See encrypted DNS (DoH and DoT) for details.
- Run the test again after changing settings.
We cover what to look for when choosing a VPN in What is a VPN? and the risks of free services in Are free VPNs safe?.
Can I have a DNS leak without a VPN?
The idea of a “leak” usually only matters when you use a VPN or encrypted DNS. Without a VPN, your DNS queries already go to the DNS server you have chosen. If you use encrypted DNS, the test helps you see whether your queries really go to the provider you selected.

