What is a DNS leak?

When your website lookups go to the network's DNS server instead of through your VPN, so the network can still see which sites you visit.

A DNS leak happens when a VPN is on but your DNS lookups, the questions “what is the address of this website?”, still go to the DNS server of the network you’re on. The rest of your traffic is hidden, but the list of sites you look up isn’t.

Why it happens

  • The VPN doesn’t set its own DNS server, so the Mac keeps using the router’s.
  • The VPN only covers some traffic, a setup called split tunneling.
  • IPv6 goes around the VPN. Some VPNs only cover IPv4, so anything sent over IPv6 takes the normal route. That’s a related leak with the same effect.
  • A VPN that’s still connecting. For a few seconds, lookups can go either way.

How to check on a Mac

Online DNS leak tests show which DNS servers answer your lookups; if one belongs to your internet provider while the VPN is on, it’s leaking. To see the DNS servers your Mac is set to use, run this in Terminal:

Terminal
scutil --dns | grep nameserver

On a Mac, the program that sends lookups is mDNSResponder.

How to fix it

Turn on your VPN app’s own DNS or leak protection setting, and turn off split tunneling if you don’t need it. Encrypted DNS also helps: lookups that leave the tunnel are then encrypted, so the network can’t read them.

On Windows

DNS leaks happen on Windows too, and are fixed the same way, in the VPN app’s settings.

Every term in the glossary