How to check for a DNS leak

A DNS leak is when sites open through the VPN, but site addresses are still looked up at your ISP's DNS. The ISP sees where you go, even though the traffic itself goes through the tunnel. You can check it in a minute: in the browser, in the VPN app or with one command.

Updated

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. 1

    Connect the VPN

    The check only makes sense with the VPN on: without it you should see your ISP's DNS.

  2. 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. 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.

Windows: PowerShell or cmd
nslookup -type=txt o-o.myaddr.l.google.com
macOS and Linux: Terminal
dig +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-subnet shows 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.

In Veli

A check in one click

In Veli, Diagnostics → Privacy shows which address and which DNS sites really see, and says “There is a leak” if something goes past the tunnel.

By default Veli uses the profile's DNS. In Settings → Security you can turn on ad and threat filtering through DNS (AdGuard, Cloudflare, Quad9) or set your own DNS, including DoH and DoT.

FAQ

Is a DNS leak dangerous?

Whoever answers your DNS requests, usually the ISP, sees which sites you open, even if the content goes through the VPN.

The VPN is on, but the check shows my ISP's DNS. Why?

Most often requests go past the tunnel because of DNS in the system settings, a second VPN or "only selected through the VPN" mode. Start with the last one.

The test shows Cloudflare or Google. Is that a leak?

Look at the country. In the VPN server's country, no: the questions go through the tunnel. In your own country, yes, or it's the browser's own DNS over HTTPS.

Isn't DNS over HTTPS enough instead of a VPN?

It hides the questions from the ISP, but the ISP still sees which addresses you connect to, and often the site name in the connection itself. A VPN hides both.

Should I check again after fixing it?

Yes: reconnect the VPN and repeat the check. New rules take effect after reconnecting.

Veli shows a DNS leak by itself

Diagnostics → Privacy shows which DNS sites see and says “There is a leak” if requests go past the tunnel.