Verify your VPN isn’t leaking DNS requests using online test tools like dnsleaktest.com—if you see your ISP’s servers in results instead of your VPN provider’s, your browsing history is exposed. Fix IPv6 leaks, misconfigured split tunneling, and default gateway issues to ensure complete DNS protection.
What Exactly is a DNS Leak?
Every time you visit a website, your computer needs to translate a human-readable domain name (like example.com) into an IP address. This translation happens through DNS (Domain Name System) servers. Normally, when you’re not using a VPN, your device sends DNS queries to your ISP’s DNS servers, giving them a complete log of every website you visit.
When you connect to a VPN, the expectation is that all your DNS queries get routed through the VPN’s encrypted tunnel to the VPN provider’s DNS servers. Your ISP shouldn’t see any of this traffic. However, due to various technical issues, your device might inadvertently send some DNS queries outside the VPN tunnel—directly to your ISP or other third-party DNS servers. This is a DNS leak.
The danger is real: even with military-grade encryption on your VPN traffic, a DNS leak exposes your browsing history. Your ISP knows exactly which domains you visited, defeating the purpose of using a VPN for privacy.
Why Do DNS Leaks Happen?
Several factors can cause DNS leaks:
IPv6 Compatibility Issues: IPv6 is the newer internet protocol, but many VPNs don’t properly handle IPv6 traffic. If your device prefers IPv6 and your VPN only routes IPv4, your DNS queries for IPv6 addresses can leak outside the tunnel.
Default Gateway Problems: Some operating systems have a default gateway configuration that doesn’t properly route all traffic through the VPN. This is particularly common on Windows.
Split Tunneling Misconfiguration: When only certain apps use the VPN while others bypass it, DNS queries from non-VPN apps can leak.
VPN Protocol Weaknesses: Some VPN protocols have known issues that can cause leaks under certain network conditions.
How to Test for DNS Leaks
Testing for DNS leaks is straightforward. Here’s how to do it:
Method 1: Using Online DNS Leak Test Services
The easiest approach is using dedicated DNS leak test websites:
- Connect to your VPN
- Visit a DNS leak test site like dnsleaktest.com or ipleak.net
- Run the extended test
What to look for: The test results should show DNS servers that belong to your VPN provider, not your ISP. If you see your ISP’s servers or servers in your physical location, you have a DNS leak.
Method 2: Manual DNS Check
You can also verify which DNS servers your system is using:
On macOS/Linux:
# Check current DNS servers
scutil --dns | grep 'nameserver'
# Or use nslookup to see which server resolves a query
nslookup example.com
On Windows:
ipconfig /all | findstr "DNS Servers"
Compare the DNS servers shown with what your VPN provider advertises. If they don’t match, you have a leak.
Method 3: Using Terminal Commands for Detailed Analysis
For more thorough testing, use these commands:
On macOS:
# Monitor DNS queries in real-time
sudo tcpdump -i any -n port 53
This shows all DNS queries leaving your system. With a properly working VPN, you should only see queries going to your VPN’s DNS servers.
On Linux:
# Use dig to test specific DNS servers
dig @dns-server-ip example.com
# Or check current DNS configuration
cat /etc/resolv.conf
Fixing DNS Leaks
If you’ve detected a DNS leak, here’s how to fix it:
1. Enable DNS Leak Protection in Your VPN
Most reputable VPN apps have built-in DNS leak protection. Check your VPN settings:
- Look for options like “DNS Leak Protection,” “Block IPv6,” or “Force VPN DNS”
- Ensure these features are enabled
- Some VPNs let you specify custom DNS servers—use the provider’s DNS for maximum privacy
2. Configure Your Operating System
You can force your system to use specific DNS servers:
On Windows:
- Go to Network & Internet → Wi-Fi or Ethernet
- Click on your connection → Hardware properties
- Scroll to DNS server assignment and select Manual
- Enter your VPN provider’s DNS servers
On macOS:
- Go to System Settings → Network → Wi-Fi (or Ethernet)
- Click Details → DNS
- Add your VPN provider’s DNS servers
On Linux (NetworkManager):
- Edit your connection settings
- Go to IPv4 Settings or IPv6 Settings
- Set DNS servers to your VPN provider’s addresses
3. Disable IPv6
If your VPN doesn’t support IPv6, disabling it is the safest approach:
On Windows:
# Disable IPv6 on all interfaces
netsh interface ipv6 install
netsh int ipv6 set interface interface_index disabled
On macOS:
# Disable IPv6
networksetup -listallnetworkservices
# Note your network service name, then:
networksetup -setv6off "Wi-Fi"
On Linux:
Add this to /etc/sysctl.conf:
# Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Then apply with sudo sysctl -p
4. Use a Firewall with VPN Kill Switch
A VPN kill switch blocks all internet traffic if the VPN connection drops, preventing any accidental leaks:
- Many VPN apps include kill switch functionality
- Alternatively, use system-level firewalls (like
ufwon Linux or built-in Windows Firewall rules)
5. Switch VPN Protocols
Some protocols are more prone to leaks than others. Try switching:
- Wireguard: Modern, fast, and generally more secure
- OpenVPN with TLS encryption: and well-audited
- IKEv2: Good stability, especially for mobile connections
Avoid PPTP or older protocols that have known security issues.
Testing After Fixes
After implementing fixes, verify your VPN is no longer leaking:
- Disconnect and reconnect your VPN
- Clear your browser cache
- Run multiple DNS leak tests from different services
- Use the terminal command method to monitor actual DNS queries
Repeat tests at different times of day and on different networks to ensure the fix is consistent.
What to Do If Your VPN Still Leaks
If you’ve tried everything and your VPN still leaks:
- Contact your VPN provider: They may have specific fixes for your configuration
- Consider an alternative VPN: Some providers simply don’t implement proper leak protection
- Use system-level DNS over HTTPS (DoH): While not a perfect solution, routing DNS through HTTPS can add a layer of protection
- Try a privacy-focused Linux distribution: Some distros like Tails or Whonix have built-in leak protection
Best Practices for DNS Privacy
Beyond fixing leaks, consider these additional measures:
- Use DNS over HTTPS (DoH) or DNS over TLS (DoT): These encrypt DNS queries themselves, adding another layer of privacy
- Use a privacy-respecting DNS provider: Services like Cloudflare (1.1.1.1), Quad9, or NextDNS don’t log your queries
- Regularly test your VPN: Network changes, app updates, or OS updates can introduce new leak vectors
- Keep your VPN app updated: Providers frequently release patches for security issues
Related Articles
- Verify That Your VPN Is Actually Working and Not Leaking
- Verify VPN is Actually Working: DNS, WebRTC, IPv6 Leak Test
- Verify Your Browser is Not Leaking Information
- Use Tcpdump to Verify VPN Traffic Is Encrypted
- How To Use Tcpdump To Verify Vpn Traffic Is Encrypted
Built by theluckystrike — More at zovo.one