A DNS leak happens when your device sends its DNS queries to a resolver outside your VPN or proxy while the rest of the traffic goes through it. The sites you visit still see the tunnel's IP, but the resolver, often your ISP's or your router's, can see which names you look up. You can test for it in a few minutes with dig, nslookup or a packet capture. This article reflects the state of things as of November 2026.
What exactly is a DNS leak?
Almost every connection by hostname starts with a DNS lookup that turns a name into an IP address. A leak is when that lookup travels outside the tunnel to a resolver you did not intend to use, while the connection itself goes through the tunnel. The resolver learns which domain names you request, but not the page content, which HTTPS still protects.
It helps to separate three things people lump together as leaks: a DNS leak (name lookups escape), an IP leak (the destination sees your real address, for example over IPv6 or WebRTC), and a plain disconnect (nothing is tunneled at all). This article is about the first one. For the second, see how to check what IP and location a website sees.
Why do DNS leaks happen?
Most leaks come from a mismatch between where an application's connection goes and where the operating system sends its lookups. The tunnel carries the connection, but the lookup is made by a different component that never heard about the tunnel. These are the usual causes:
- Proxy settings that not everything honors. A system proxy is a request that applications may follow or ignore, and the OS resolver is not an application that follows it. TUN mode vs system proxy explains what each approach actually captures.
- Local resolution before SOCKS5. With a
socks5://URL, curl and many other tools resolve the hostname on your machine and send only the IP to the proxy. Thesocks5h://form hands the hostname to the proxy instead. - Split routing. If a rule sends a domain direct, its lookup usually goes direct too, and lookups can happen before any rule is evaluated.
- Multiple network adapters. Some Windows versions can query the DNS servers of several adapters and use whichever answers first, so a lookup may leave through the physical adapter even with the VPN adapter up.
- Browser secure DNS. Chrome, Edge and Firefox can send lookups with DNS over HTTPS (DoH) to a provider chosen in the browser settings, independent of the OS resolver.
- IPv6. A router can advertise an IPv6 DNS server that the tunnel does not cover.
- Reconnects. During a short tunnel drop, queries go out over the normal path.
How do I test for a DNS leak?
Ask the network which resolver is actually contacting authoritative servers on your behalf, once with the tunnel off and once with it on. If the resolver address belongs to your ISP or router while the tunnel is up, lookups are escaping. Here are three methods, from quickest to most conclusive.
1. Ask a DNS server who is asking
dig +short whoami.akamai.net
nslookup whoami.akamai.netThe name whoami.akamai.net answers with the address of the recursive resolver that reached Akamai's authoritative server, which is exactly the address a leak exposes. Run it with the tunnel off and note the result, then run it again with the tunnel on. If the address is unchanged and belongs to your ISP, lookups are not using the tunnel. Flush the local cache first if a result looks stale (ipconfig /flushdns on Windows, resolvectl flush-caches on Linux with systemd-resolved). Web-based leak test pages work on the same idea: they make your browser resolve unique random names and show which resolvers asked.
2. Check which resolvers are configured
resolvectl status # Linux with systemd-resolved
scutil --dns # macOS
ipconfig /all # WindowsLook at which DNS servers are attached to which adapter. A physical adapter that still lists your router with higher priority than the tunnel adapter is a strong hint.
3. Watch port 53 on the physical interface
sudo tcpdump -n -i eth0 'udp port 53 or tcp port 53'Replace eth0 with your physical interface (ip link lists them), then run dig example.com in another terminal. Plain-text DNS leaving the physical interface while the tunnel is up is a definitive leak. Tunnel traffic itself shows up as encrypted packets to the server, not as port 53. Encrypted DNS (DoH on port 443, DNS over TLS on port 853) will not show here, so check browser settings separately.
How do I fix a DNS leak?
Make the lookup travel the same way as the connection. The right fix depends on the cause, and a TUN-mode client or a hostname-forwarding proxy setting covers most cases. This table maps each cause above to a fix.
| Cause | Fix |
|---|---|
| OS resolver bypasses the system proxy | Use TUN mode so port 53 traffic from the OS enters the virtual adapter, then re-run the tests. |
Local resolution with socks5:// | Use socks5h:// in curl, or enable "Proxy DNS when using SOCKS v5" in Firefox. |
| Browser DoH to an unrelated provider | Turn off Secure DNS in the browser or choose a resolver that matches your setup. |
| Several adapters on Windows | Set DNS on the tunnel adapter and review the Group Policy "Turn off smart multi-homed name resolution". |
| IPv6 not covered by the tunnel | Confirm whether your tunnel carries IPv6; as a test, disable IPv6 on the physical adapter and re-run. |
| Gaps during reconnects | Use your client's option to block traffic while the tunnel is down, if it has one. |
For proxies, the difference is easy to see with curl:
curl -x socks5://user:password@proxy.example.com:1080 https://example.com
curl -x socks5h://user:password@proxy.example.com:1080 https://example.comThe first command resolves example.com locally and sends the proxy an IP. The second sends the proxy the hostname, so the proxy resolves it. An HTTP proxy always receives the hostname in its CONNECT request, so the proxy resolves it there. Differences between the two protocols are covered in HTTP vs SOCKS5 proxies.
Is every DNS leak a problem?
Not equally. The resolver sees domain names, and an ISP resolver may log them or rewrite answers. A resolver in the wrong region can also hand you a CDN node that is far from the tunnel's location. If the resolver is a public one you chose on purpose, the impact is small. Decide based on who the resolver is, not on the word "leak".
Where AnboVPN fits
AnboVPN's official clients support TUN mode, which takes over device traffic through a virtual adapter and is the setup best suited to keeping the operating system's own lookups on the same path as your apps. The clients also support app-level smart routing, so remember that anything you route direct will resolve direct as well. If you use the HTTP/SOCKS5 proxy connection with your own tools, use socks5h:// or an equivalent proxy-DNS option. Whichever mode you choose, run the tests above once to see what your own setup does. Clients are on the download page.






