How to test a VPN or proxy for leaks
Five checks in ten minutes: a baseline, exits, DNS, WebRTC and what happens when the tunnel drops. What each result proves, and what it doesn’t.
2 min read
On this page
A VPN showing "connected" tells you that a tunnel exists. It doesn't tell you that everything goes through it. Pages, DNS lookups, WebRTC and IPv6 can each take a different path, so each has to be tested.
- 1BaselineVPN off: note your real addresses
- 2ExitsVPN on: does any exit match the baseline?
- 3DNSWho answers your lookups?
- 4WebRTCDoes UDP use the same exit?
- 5InterruptionWhat happens when the tunnel drops?
Without step 1 you can’t tell a leak from an address you don’t recognize.
1. Record the baseline
Turn the VPN or proxy off. Open the network exit check and write down:
- your IPv4 address and the provider's name
- your IPv6 address, if there is one
- the country
Everything after this is a comparison with these values.
2. Check the exits
Turn the VPN on, close and reopen the browser, and run the check again:
It asks several sites which address they see. None of the addresses should be in your baseline, and neither should your provider's name.
Finding several exits isn't a problem in itself. VPN services use many addresses. What matters is whether one of them is yours. With split tunneling on, some sites are meant to see your own address, so turn it off for the test, or know which ones those are.
The IPv6 article explains how to fix an IPv6 leak.
3. Check DNS
Run the DNS leak check, choosing the extended test. Read the names of the networks, not just the verdict. It compares countries, so if your VPN exit is in your own country, a leak to your provider still shows as Correct. Your provider's name in the list means a leak. What is a DNS leak? has the causes and fixes.
4. Check WebRTC
Run the WebRTC leak check. An additional public IP that's in your baseline is a leak. Pay attention to any IPv6 address it lists. Why WebRTC shows another IP has the fixes.
5. Interrupt the tunnel
Most leaks people care about happen in the seconds when a VPN reconnects. A kill switch is meant to block everything until the tunnel is back. Test it: print your address once a second, and break the connection while it's running.
On macOS or Linux:
while true; do echo "$(date +%T) $(curl -s -m 3 https://www.cloudflare.com/cdn-cgi/trace | grep '^ip=')"; sleep 1; doneOn Windows, in PowerShell:
while ($true) { "$(Get-Date -Format T) $((curl.exe -s -m 3 https://www.cloudflare.com/cdn-cgi/trace) -match '^ip=')"; Start-Sleep 1 }While it runs, switch the VPN to another server, turn Wi-Fi off and on, and put the computer to sleep for a minute. Stop with Ctrl+C. This is how a leak looks:
21:04:11 ip=198.51.100.721:04:12 ip=198.51.100.721:04:13 ip=203.0.113.2421:04:1821:04:20 ip=198.51.100.9The output is an illustration: 198.51.100.x stands for the VPN and 203.0.113.24 for the address in the baseline. An empty line is what you want to see during a reconnect. Your own address, even once, means that the kill switch is off or doesn't work.
Don't quit the VPN program as the test, since many stop blocking when you deliberately disconnect. Repeat with curl -6 if you have IPv6.
What a clean result is worth
Repeat the test when something changes: a new version of the VPN or operating system, a new network, another browser. Phones need their own test, and so do apps that don't use the browser.
What no leak test can tell you
- What the VPN provider sees. It replaces your internet provider in that position. No test from your side shows what it records.
- Whether a site recognizes you. Cookies, sign-ins and your browser's characteristics have nothing to do with the address.
- Whether a site knows it's a VPN. Look the exit address up on the home page to see whether it's listed as a proxy or datacenter address.