On this page
What DNS has to do with it
Before opening a site, the device asks a DNS server what address the name has. These questions are short and usually unencrypted, and whoever answers them gets the full list of sites you visit, with times. Normally that is your ISP.
A VPN should send these questions into the tunnel too: to the VPN server's DNS or to the one you chose. If they go past the tunnel, the content of your traffic is hidden, but its map is not. That is a DNS leak.
How to check in a minute
- 1
Connect the VPN
The check only makes sense with the VPN on: without it you should see your ISP's DNS.
- 2
Run a leak test
In Veli it's Diagnostics → Privacy. In a browser, any DNS leak test site will do. Such sites make your device look up a few unique random names and then see which DNS servers came to ask for them. Choose the extended test if there is one: it sends more questions and catches leaks that happen now and then.
- 3
Look at who owns the servers
The result is a list of DNS servers with the company and the country. Compare it with the table below.
How to read the result
Public DNS services answer from the point nearest to whoever asks. That is why Cloudflare in your own country means the question left from your network, not from the VPN server.
Your ISP's servers or your mobile operator's
What it meansA leak: DNS questions go past the tunnel
The servers of the VPN server's hosting, in the server's country
What it meansAll is well: DNS goes through the tunnel
Cloudflare, Google or Quad9 in the server's country
What it meansAll is well, if you or the profile chose that DNS: the questions go through the tunnel to a public DNS
Cloudflare, Google or Quad9 in your own country
What it meansThe questions go to a public DNS past the tunnel. Often it's the browser's own DNS over HTTPS. Turn it off and check again
A mix of your ISP and the VPN
What it meansA partial leak: some questions go past the tunnel. On Windows it's often parallel lookups over all adapters, or DNS over IPv6
Check with one command
Google has a service name that answers with the address of the DNS server that asked it. If the address belongs to your ISP, the question went past the tunnel.
nslookup -type=txt o-o.myaddr.l.google.comdig +short TXT o-o.myaddr.l.google.com- The answer has one or two lines with an IP address in quotes. Look that address up in any "whois" or "IP lookup" service: it shows the owner and the country.
- The owner is your ISP — a leak. A hosting company in the server's country, or Google, Cloudflare or Quad9 there — DNS goes through the tunnel.
- A line with
edns0-client-subnetshows the network of whoever asked first. If it is your home network and the VPN is on, the DNS server you use passes your network on: choose another one.
Why DNS leaks
- The system asks DNS directly, past the tunnel, especially if your ISP's DNS is written into the network settings.
- Windows asks all adapters at once. For speed it sends a DNS question over every network adapter in parallel and takes the first answer. Unless the VPN client blocks that, part of the questions goes past the tunnel.
- DNS over IPv6. The router hands out an IPv6 DNS server, while the tunnel carries only IPv4: questions go to the ISP over IPv6.
- Another VPN or proxy is running alongside, and requests go through it.
- "Only selected through the VPN" mode is on: the browser goes direct, and so does its DNS. That is expected.
- The browser uses its own DNS over HTTPS and ignores the system settings.
How to fix it
- Keep the DNS the VPN profile gives you, or set your own in the VPN client's settings, including DoH or DoT.
- Turn off the second VPN or proxy.
- Browser DNS over HTTPS: in Chrome it's Settings → Privacy and security → Security → Use secure DNS, in Edge it's Settings → Privacy, search, and services → Use secure DNS, in Firefox it's Settings → Privacy & Security → DNS over HTTPS. Either turn it off so the browser uses the VPN's DNS, or leave it on knowingly: then the questions go to the browser's provider, encrypted.
- Android: Private DNS in the network settings takes priority over the VPN's DNS. Set it to Automatic if you want the VPN to choose.
- If you want one browser through the VPN, add it to the list rather than the other way round.
- After any change, reconnect the VPN and run the test again.