Research publication Leak testing
How to test your VPN for leaks: a step-by-step guide
A useful VPN leak test compares what the internet sees with and without the VPN, for four paths — IPv4, DNS, IPv6 and WebRTC — and then repeats the checks while the tunnel is forced to fail. This guide gives the steps, the commands and how to read each result.
Abstract
Most people test a VPN by opening a single leak-test website once, while the tunnel is connected and healthy. That catches gross misconfiguration but misses the conditions in which real leaks occur: a resolver configured outside the tunnel, an IPv6 path the client never touches, browser features that ask for addresses on their own, and the seconds after a network change or reconnect. This guide sets out a repeatable procedure that anyone can run with a browser, a terminal and, optionally, a packet capture tool. It starts with a baseline taken without the VPN, then checks the public IPv4 address, the DNS resolver, IPv6 reachability and WebRTC candidates, and finally generates continuous traffic while forcing the failures a kill switch must survive. For each step we explain what the result means, what it cannot show and how to record it so that it can be repeated and compared. Deeper analysis of each leak class is in our separate publications on DNS, IPv6 and WebRTC leaks and on kill-switch design.
What counts as a leak
A VPN leak is any traffic, or any identifier such as an IP address or DNS query, that reaches the network outside the encrypted tunnel when the VPN is supposed to be carrying it.
Four paths account for nearly all leaks a user can observe without special equipment: the public IPv4 address that websites see; the DNS resolver that turns names into addresses; IPv6 traffic that the client neither tunnels nor blocks; and browser features such as WebRTC that discover network addresses on their own. A fifth category is not a path but a moment: traffic that escapes while the tunnel is starting, reconnecting or broken, which is what a kill switch is meant to prevent.
Seeing the VPN server’s address on a website is not a leak — it is the intended result. A leak is the appearance of something that identifies you or your network: your real address, your internet provider’s resolver, or a packet on the physical interface that is not part of the tunnel.
Before you start: take a baseline
A leak test compares two states. Without a record of the first, there is nothing to compare against. With the VPN disconnected, write down:
- Your public IPv4 address and, if your network has one, your public IPv6 address.
- The DNS resolver addresses a DNS leak-test page reports for your connection. These usually belong to your internet provider or to a public resolver you have configured.
- The environment: date and time, operating system and version, VPN client and version, protocol, server location, and the state of settings that affect leaks — kill switch, local network access, split tunnelling, custom DNS and IPv6 handling.
Close other VPN, proxy and “privacy” tools, which can mask or cause results. Use a browser profile without extensions for the browser checks; content blockers sometimes disable WebRTC and make a leaky configuration look clean. If you can, use two independent leak-test services rather than one, because each sees only the traffic that reaches its own servers. The commands below use ip.example as a placeholder; replace it with an IP-echo service you trust.
Step 1: public IPv4 address
Connect the VPN and check the public IPv4 address from both a browser and the command line. The command line matters because applications do not all share the browser’s network settings.
# macOS and Linux. -4 forces IPv4. In Windows PowerShell type curl.exe, not curl.
curl -4 https://ip.example/
Pass: an address belonging to the VPN server. Leak: your baseline address. If the browser shows the VPN address and the terminal does not, look for split-tunnelling rules or a proxy configured only in the browser.
Step 2: DNS resolver
DNS leak tests work indirectly. The page makes your device look up several random, never-before-used names under a domain the testing service controls. Because nobody has asked for those names before, the queries must travel all the way to the service’s authoritative name server, which records the address of the recursive resolver that asked [1, 2]. The page then shows you those resolver addresses.
Pass: resolvers operated by the VPN provider, or a resolver you deliberately configured to be reached through the tunnel. Leak: any resolver from your baseline — typically your internet provider’s — or one belonging to the local network you are on.
Two cautions apply. First, the test shows which resolver asked, not the path your query took: a query to a public resolver can travel inside or outside the tunnel and produce the same result. Second, browsers that use DNS over HTTPS send their own queries directly to a DoH server [3], so a browser-based test may look clean while other applications still use a leaking system resolver. Repeat the check from the operating system: run nslookup example.com and note which server answers, or capture port 53 and port 853 traffic on the physical interface during the test [4]. Why resolvers diverge from the tunnel, and how operating systems choose between them, is analysed in How DNS leaks happen in VPN clients: a technical taxonomy (VPNL-R-2026-001).
Step 3: IPv6
If your baseline had no IPv6 address, this step cannot show a leak on the current network — note that, and repeat it later on a network with IPv6. If it did, check IPv6 separately:
curl -6 https://ip.example/
Two results are acceptable: an IPv6 address belonging to the VPN (IPv6 is tunnelled), or a connection failure (IPv6 is blocked while the VPN is on). Your native IPv6 address is a leak. The risk is not theoretical: when both address families work, operating systems and applications prefer IPv6 for many destinations [5, 6], so an untunnelled IPv6 path can carry most of your traffic while every IPv4 test passes. The mechanisms, including NAT64 and IPv6-only mobile networks, are covered in IPv6 and WebRTC: the overlooked leak paths (VPNL-R-2026-005).
Step 4: WebRTC in the browser
WebRTC lets web pages set up real-time audio, video and data connections. To find a direct path between peers it gathers candidate addresses, including addresses learned from STUN servers on the internet [7, 8]. A page can read those candidates without asking permission in many configurations, which is why a WebRTC check belongs in every browser test.
Use a WebRTC leak-test page, or open the browser’s own diagnostics — about:webrtc in Firefox, chrome://webrtc-internals in Chromium-based browsers — while a WebRTC page is active. Pass: only the VPN’s address, private addresses, or host candidates shown as random .local names, which browsers use to hide local addresses [9]. Leak: your baseline public IPv4 or IPv6 address. Browser policies that control which interfaces WebRTC may use are described in RFC 8828 [10].
Step 5: force failures while traffic runs
Steps 1–4 test the steady state. The leaks that matter most appear at transitions: the tunnel restarting, the network changing, the device waking from sleep. To see them you need traffic that runs continuously and records which address it left from. A one-line loop is enough:
# macOS / Linux: print time and public IPv4 address once per second.
while true; do date +%T; curl -4 -s --max-time 2 https://ip.example/ || echo "no connectivity"; sleep 1; done
# Windows PowerShell equivalent.
while ($true) { Get-Date -Format T; try { Invoke-RestMethod -Uri https://ip.example/ -TimeoutSec 2 } catch { 'no connectivity' }; Start-Sleep 1 }
With the loop running, trigger each condition in turn and watch the output:
- Turn Wi-Fi off and on again, or unplug and replug the network cable.
- Switch between two networks, for example Wi-Fi and a phone hotspot.
- Switch VPN servers several times.
- Suspend the device for a few minutes and wake it.
- Block the VPN server upstream (for example by disconnecting the router’s internet uplink for 30 seconds) so that the client has to detect the loss and reconnect.
- Restart the device with the VPN set to connect automatically, and start the loop as early as you can.
Pass: the loop prints the VPN address or “no connectivity”, never your baseline address. Leak: a single line with your real address. Because a leak can be one packet long, the stronger method is to capture on the physical interface with tcpdump or Wireshark [11, 12] and filter out the encrypted tunnel traffic to the server; any remaining packet to the internet is a leak candidate.
# Replace en0 with your physical interface, 203.0.113.10 with the VPN server address.
sudo tcpdump -n -i en0 'not host 203.0.113.10 and not arp and not (udp port 67 or udp port 68)'
Why route-based and firewall-based kill switches behave differently under these events is the subject of Kill switches compared: firewall-based vs route-based enforcement (VPNL-R-2026-003).
Reading the results
| Check | Pass | Leak | Inconclusive |
|---|---|---|---|
| Public IPv4 | VPN server address | Baseline address | Browser and terminal disagree |
| DNS | VPN or intentionally configured resolver | Internet provider or local-network resolver | Browser uses DoH; system not checked |
| IPv6 | VPN IPv6 address, or no IPv6 connectivity | Native IPv6 address | Network has no IPv6 |
| WebRTC | VPN, private or .local candidates only | Baseline public address in candidates | Extension disabled WebRTC |
| Failure conditions | VPN address or no connectivity throughout | Any baseline address, any non-tunnel packet | Condition not actually triggered |
An inconclusive result is not a pass. Record it, change the environment so the check can succeed or fail — enable IPv6, remove the extension — and run it again.
Common mistakes
- Testing once. Leaks at transitions are intermittent. Repeat each failure condition several times.
- Testing only in the browser. Browsers may use their own DNS, proxy and WebRTC settings. Check from the terminal as well.
- Excluding the browser by accident. If split tunnelling bypasses the browser, every browser test reports your real address — correctly.
- Trusting labels. Leak-test pages sometimes label a resolver with an organisation name; compare addresses with your baseline instead.
- Forgetting the test is visible. The testing service sees your addresses too. Prefer services with a clear privacy policy, and do not test with sensitive accounts signed in.
Recording results so they mean something
A leak result is evidence only if someone — including you, six months later — can tell what was tested. For each run, keep the environment notes from your baseline, a screenshot or text copy of every result, and any packet capture. Name files with date and condition, and keep the originals unedited; a SHA-256 hash of each file, recorded at the time, lets you show later that it has not changed (see What a SHA-256 hash proves and what it does not (VPNL-R-2026-004)). This is a small-scale version of the procedure in our leak-testing methodology and our evidence-handling rules, which follow the plan–execute–record structure of NIST SP 800-115 [13].
Frequently asked questions
Is one online leak test enough?
No. It is a quick check of the steady state from one service’s point of view. It cannot see traffic that does not reach that service, other applications, IPv6 on a network without IPv6, or what happens during a reconnect.
What does a DNS leak actually expose?
The names of the sites and services you use, to the operator of the leaking resolver and to anyone on the network path if the queries are unencrypted. It does not expose page contents, which HTTPS protects separately.
Should I simply disable IPv6?
Disabling IPv6 removes one leak path but can break connectivity on IPv6-only and NAT64 mobile networks. A client that tunnels IPv6, or blocks it while connected, is the better fix; disabling it is a workaround.
Can a VPN that passes all five steps still leak?
Yes. These steps cover the common paths on one device, one network and one client version. Hostile local networks, unusual applications and new client releases can behave differently, which is why test results always carry a date and version.
Limitations
This guide is designed for self-testing on ordinary hardware. It cannot replace a controlled laboratory setup with a capture point outside the device, scripted failure injection and many repetitions, and it makes no claim about any particular VPN product. A pass on your network shows the behaviour of that client version, on that platform, under the conditions you tested — nothing more.
References
All sources are publicly available primary documents. Numbers correspond to the bracketed citations in the text.
- 1Mockapetris, P. (1987). Domain Names — Implementation and Specification (RFC 1035). RFC Editor. https://www.rfc-editor.org/rfc/rfc1035
- 2Wicinski, T. (Ed.). (2021). DNS Privacy Considerations (RFC 9076). RFC Editor. https://www.rfc-editor.org/rfc/rfc9076
- 3Hoffman, P., & McManus, P. (2018). DNS Queries over HTTPS (DoH) (RFC 8484). RFC Editor. https://www.rfc-editor.org/rfc/rfc8484
- 4Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., & Hoffman, P. (2016). Specification for DNS over Transport Layer Security (TLS) (RFC 7858). RFC Editor. https://www.rfc-editor.org/rfc/rfc7858
- 5Thaler, D. (Ed.), Draves, R., Matsumoto, A., & Chown, T. (2012). Default Address Selection for Internet Protocol Version 6 (IPv6) (RFC 6724). RFC Editor. https://www.rfc-editor.org/rfc/rfc6724
- 6Schinazi, D., & Pauly, T. (2017). Happy Eyeballs Version 2: Better Connectivity Using Concurrency (RFC 8305). RFC Editor. https://www.rfc-editor.org/rfc/rfc8305
- 7World Wide Web Consortium (W3C). (2021). WebRTC: Real-Time Communication in Browsers (W3C Recommendation; latest version). W3C. https://www.w3.org/TR/webrtc/
- 8Keranen, A., Holmberg, C., & Rosenberg, J. (2018). Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal (RFC 8445). RFC Editor. https://www.rfc-editor.org/rfc/rfc8445
- 9Fablet, Y., de Borst, J., Uberti, J., & Wang, Q. (n.d.). Using Multicast DNS to protect privacy when exposing ICE candidates (Internet-Draft draft-ietf-mmusic-mdns-ice-candidates). Internet Engineering Task Force. Work in progress. https://datatracker.ietf.org/doc/draft-ietf-mmusic-mdns-ice-candidates/
- 10Uberti, J., & Shieh, G. (2021). WebRTC IP Address Handling Requirements (RFC 8828). RFC Editor. https://www.rfc-editor.org/rfc/rfc8828
- 11The Tcpdump Group. (n.d.). TCPDUMP & LIBPCAP. https://www.tcpdump.org/
- 12The Wireshark Foundation. (n.d.). Wireshark documentation. https://www.wireshark.org/docs/
- 13Scarfone, K., Souppaya, M., Cody, A., & Orebaugh, A. (2008). Technical Guide to Information Security Testing and Assessment (NIST Special Publication 800-115). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-115
Cite this publication
APA style
VPN Network Research Labs. (2026, November 17). How to test your VPN for leaks: A step-by-step guide (Research Publication No. VPNL-R-2026-007, Version 1.0). https://vpn.com.de/research/how-to-test-your-vpn-for-leaks
BibTeX
@techreport{vpnl-r-2026-007,
author = {{VPN Network Research Labs}},
title = {{How to test your VPN for leaks: a step-by-step guide}},
institution = {VPN Network Research Labs},
type = {Research Publication},
number = {VPNL-R-2026-007},
year = {2026},
month = nov,
date = {2026-11-17},
version = {1.0},
url = {https://vpn.com.de/research/how-to-test-your-vpn-for-leaks},
langid = {en},
note = {Version 1.0}
}
Download citation
Cite the document ID and the version you read. Document IDs are permanent; substantive changes receive a new version number and an entry in the revision history below.
Revision history
| Version | Date | Change |
|---|---|---|
| 1.0 | Initial publication. |
Found an error? Write to support@vpn.com.de. Corrections are handled under our corrections and retractions policy and are never applied silently.
Methodology and definitions
Terms used in this publication
Test records
This publication contains no results about specific products. Product tests, audits and their evidence are published in the Report Registry and the Evidence Database.