DNS Leaks: How to Test, Fix, and Prevent Them

By  |  Updated: September 25, 2026  |  ~20 min read

A DNS leak happens when a name lookup that should follow your VPN’s protected path instead reaches a resolver through the underlying ISP, Wi-Fi, cellular, or another unintended route. The VPN can still show “connected,” your public IP can look correct, and HTTPS can still encrypt page content—yet the resolver outside the tunnel may learn which domains your device asks for.

Modern diagnosis is more nuanced than “a test showed a DNS server I do not recognize.” Browsers can use DNS over HTTPS (DoH), operating systems can use encrypted DNS, corporate VPNs can intentionally split private and public names, and a public resolver reached through the VPN is not automatically a tunnel leak. This guide shows how to tell the difference.

Quick answer

How do you prevent a DNS leak?

Use the VPN provider’s native app, leave DNS on automatic unless the provider instructs otherwise, enable its kill switch, and avoid stacking a custom browser/OS resolver until you know how it interacts with the tunnel. Test before connecting, while connected, after changing Wi-Fi, and during a forced reconnect. A leak is strongly indicated when your pre-VPN ISP resolver—or another resolver reached through your real network—reappears while the full-tunnel VPN is active.

Do not “fix” every unfamiliar result. A VPN may use a resolver in the same data center under a different organization name. A browser may intentionally send encrypted DNS to a chosen provider through the VPN exit. Check route, timing, location, provider documentation, and multiple apps before concluding that the tunnel leaked.

4 layersBrowser, OS resolver, VPN interface, and physical network can each change the DNS route.
3 test statesBaseline, connected, and transition/drop testing catch different failure modes.
DoH ≠ VPNEncrypted DNS protects the lookup path but does not tunnel the rest of your traffic.
DNS ≠ URLA query commonly reveals a domain, not the full HTTPS path, page content, or search terms.

DNS leak path and methods to test, fix, and prevent VPN DNS leaks

Table of Contents

The request pathWhat Is a DNS Leak?

The Domain Name System maps names such as example.com to IP addresses. A typical device sends the query to a recursive resolver selected by the router, ISP, operating system, browser, or administrator. The resolver may contact other DNS infrastructure and return an answer the app can use.

With a full-tunnel consumer VPN, the intended path is normally: app → system or browser resolver → encrypted VPN tunnel → the VPN’s resolver (or an approved resolver reached from the VPN exit). A leak occurs when a query that the VPN promises to protect bypasses that path and leaves via the physical interface or another excluded route.

1. AppRequests an address for a domain; caches may answer without a new query.
2. Browser / OSChooses classic DNS, DoH, DoT, cache, or a policy-specific resolver.
3. VPN routingRoutes or blocks IPv4/IPv6 DNS according to tunnel and firewall rules.
4. ResolverVPN-owned, third-party, enterprise, or unintended ISP resolver answers.
5. WebsiteReceives the VPN exit IP; DNS and web connections are separate events.
Precise definition: a DNS privacy failure is about the path and intended resolver, not merely encryption. Plain DNS inside an encrypted VPN tunnel is protected from the local ISP. DoH sent outside the tunnel is encrypted from the ISP but may still violate the VPN routing/privacy promise and expose your real IP to the DoH resolver.

Realistic impactWhat Does a DNS Leak Reveal?

A resolver can usually see the queried domain, request time, record type, and source IP that reached it. Repeated queries can reveal interests and service use. But “your entire browsing history is exposed” is too broad: DNS normally does not include the full HTTPS URL path, page content, form entries, passwords, or the exact video watched. Cached answers may produce no fresh query, and multiple apps generate background lookups unrelated to deliberate browsing.

A leaking resolver may learn

  • Domains and subdomains requested
  • Timing and frequency of lookups
  • Your real source IP if the request bypasses the tunnel
  • Device/application clues from patterns or encrypted-DNS metadata

DNS alone normally does not reveal

  • Full HTTPS URLs and page paths
  • Encrypted page contents or passwords
  • The account logged into a website
  • Every page visited when caching or encrypted service discovery applies

A DNS leak also does not necessarily expose your real IP to the website itself. It exposes information to the unintended resolver and observers on that path. An IPv4, IPv6, or WebRTC leak is the category more likely to reveal a non-VPN address directly to a test page or peer.

Do not mix the symptomsDNS Leaks vs IPv4, IPv6, WebRTC, and Traffic Correlation

Leak / issueWhat escapesWho may see itCorrect test
DNS leakDomain lookup through unintended route/resolverISP, local network, unintended resolverControlled DNS queries plus resolver comparison
IPv4/IPv6 leakReal public address outside tunnelDestination or test siteCompare public IPv4 and IPv6 before/after
WebRTC exposureCandidate addresses used for peer connectivityWeb page or communications peerBrowser ICE-candidate test
Split-tunnel bypassSelected app/site traffic and possibly its DNSUnderlying network and destinationTest inside and outside the excluded app
Traffic correlationTiming, direction, and volume—not a routing “leak”Observer with visibility at both endsThreat-model analysis, not a browser leak test

Read our split tunneling vs full tunneling guide before treating intentionally excluded traffic as a software failure.

Where routing goes wrongCommon Causes of DNS Leaks

VPN route or firewall failure

The app does not install the DNS route, loses it after sleep/network change, or briefly removes protection during reconnect.

Custom DNS overrides

A manually configured OS, router, security app, or Private DNS setting can compete with the VPN’s resolver.

Browser-level encrypted DNS

A browser can resolve independently of the OS. Depending on routing, this may use an intentional resolver through the tunnel or bypass VPN DNS policy.

Incomplete IPv6 handling

An IPv4-only tunnel that neither supports nor blocks IPv6 can allow IPv6 DNS and traffic onto the underlying interface.

Split DNS and split tunneling

Enterprise profiles route internal namespaces to corporate DNS and public names elsewhere. Consumer split tunneling may exclude an app and its lookups.

Multiple active interfaces

Ethernet, Wi-Fi, cellular, virtual adapters, containers, and other VPN clients can leave competing DNS priorities or stale routes.

Captive portals and transitions

Hotel/airport login pages may require local DNS before the tunnel starts; roaming between networks can expose a short reconnect window.

Manual protocol profiles

Third-party WireGuard/OpenVPN configs may omit DNS directives or fail to integrate with the platform resolver as well as the native app.

Outdated blanket advice: do not disable IPv6, Teredo, Smart Multi-Homed Name Resolution, or system services merely because an old checklist says so. First prove which interface and resolver leaked. Disabling a platform feature can break local discovery, enterprise access, or connectivity while leaving the actual browser-level cause untouched.

Three different protectionsDoH, DoT, DNSSEC, and VPN DNS

DNS over HTTPS and DNS over TLS encrypt the connection from client to resolver. DNSSEC authenticates signed DNS data; it does not hide queries. A VPN encrypts the route from your device to the VPN server and can carry classic DNS safely inside that tunnel. These tools overlap but solve different problems.

TechnologyProtects againstDoes not solveVPN interaction
VPN-carried DNSLocal ISP/Wi-Fi observation between device and VPNTrust in the VPN/resolver; endpoint trackingUsually the simplest consumer configuration
DoHOn-path DNS reading/tampering to the DoH resolverResolver visibility; all-device traffic; DNSSEC authenticityMay run through tunnel or follow an app-specific path
DoT / Private DNSOn-path reading/tampering to the configured resolverResolver visibility; website trafficCan conflict with provider DNS on some platforms
DNSSECForged signed DNS answers when validation succeedsQuery confidentiality or IP maskingComplementary to VPN and encrypted DNS

The IETF’s DNS over HTTPS standard (RFC 8484) explicitly separates transport privacy from DNSSEC authenticity and notes that IP, TLS, HTTP headers, and long-lived connections can still enable correlation.

Browser defaults matter. Chrome’s automatic Secure DNS mode can fall back to unencrypted resolution when lookup fails; a manually selected custom provider does not default to that fallback. Firefox’s default protection can disable DoH when it detects VPN, enterprise, parental-control, or network policy, while an explicit “Max Protection” choice behaves differently. Mozilla’s current DoH documentation explains these modes and resolver trust trade-offs.

A reproducible procedureHow to Test for DNS Leaks Correctly

Online tools are useful, but they report the recursive resolver that contacted the test’s authoritative DNS—not necessarily the resolver address configured on your device. Anycast, relays, resolver egress, and data-center ownership can make names or locations look unfamiliar.

  1. Record a disconnected baseline. Note public IPv4/IPv6, resolver organization, resolver country, browser, network, and any custom DNS setting.
  2. Clear the test state. Use the test site’s fresh/random hostname. A cached domain may not trigger a new lookup; private/incognito mode alone does not guarantee an empty OS cache.
  3. Connect with full tunneling. Choose a VPN server in a clearly different region. Confirm the app says connected and the public IP matches that exit.
  4. Run standard and extended DNS tests. Repeat in two browsers. If results differ, browser DoH or an extension is a likely cause.
  5. Inspect system resolver state. On Windows use Get-DnsClientServerAddress and Resolve-DnsName; macOS use scutil --dns; Linux with systemd-resolved use resolvectl status.
  6. Test transitions. Change Wi-Fi, wake from sleep, switch VPN servers, and force a reconnect. A kill switch should prevent queries on the physical interface during the gap.
  7. Check IPv6 and split apps separately. A clean IPv4 result does not prove IPv6 routing; an excluded app is expected to use the non-VPN path.

Diagnostic confidence by test depth

Qualitative confidence, not measured prevalence. More independent observations reduce false positives.

One browser test
Baseline + VPN
Two browsers + OS
Plus transition test

The bar lengths visualize diagnostic completeness only; they are not probabilities.

Avoid false positivesHow to Interpret DNS Leak Test Results

Likely protectedPublic IP is the VPN exit; ISP resolver disappears; DNS belongs to the VPN or an expected resolver and appears near the exit.
InvestigatePublic IP is correct, but a public DoH resolver appears. Compare browsers and determine whether the request still exits through the tunnel.
Likely leakYour baseline ISP resolver or resolver near your real location reappears while a full-tunnel VPN is active.
Split DNSCorporate names use enterprise DNS while public names use another resolver. This can be intentional and necessary.
IPv6 leakVPN IPv4 is shown but your real IPv6 or IPv6-selected DNS path remains visible.
Transition leakTests are clean when stable but baseline resolvers appear during reconnect, sleep/wake, or network switching.

Do not judge by resolver brand alone. Some VPNs colocate DNS in the same data center, and the resolver may be registered to a hosting company. Conversely, a famous privacy resolver is not proof of a clean VPN route: if the device contacted it outside the tunnel, it saw your real IP even though the DNS payload was encrypted.

Fix the proven layerHow to Fix DNS Leaks on Each Platform

Universal repair order

  1. Reconnect and update the native VPN app. Remove competing VPN clients or stale virtual adapters only if you know they are unused.
  2. Return DNS to automatic. Let the VPN install its resolver unless its support documentation specifies custom addresses.
  3. Enable the kill switch. Prefer an always-on or “block without VPN” mode when available; read how VPN kill switches work.
  4. Align browser Secure DNS. Start with the browser’s default/current-provider mode or temporarily disable custom DoH to see whether results converge.
  5. Retest every route. Test IPv4, IPv6, multiple browsers, and reconnect transitions. If the native app still leaks, send evidence to the provider and switch services if unresolved.

Windows 11

Set IPv4 and IPv6 DNS assignment to Automatic on the physical adapter unless the VPN requires otherwise. Inspect adapters and resolver assignments rather than relying on nslookup alone; Microsoft notes that apps with their own resolver can bypass Windows DNS policy.

Get-DnsClientServerAddress Resolve-DnsName example.com ipconfig /flushdns

Check Chrome/Firefox encrypted-DNS settings separately. Enterprise VPNs may intentionally use Name Resolution Policy Table rules for specific namespaces, so do not delete NRPT entries on a managed device.

macOS

Use scutil --dns while disconnected and connected to compare scoped resolvers. Remove unused DNS profiles or network extensions, set the active Wi-Fi/Ethernet DNS page back to automatic, and inspect browser DoH. On managed Macs, split DNS may be installed by MDM and should be changed only by the administrator.

Android

Android VPN apps can assign DNS servers to their virtual interface; if none is assigned, the default network’s DNS can remain relevant. Start with Private DNS set to Automatic or follow the provider’s instructions, enable Always-on VPN plus “Block connections without VPN” when the app supports it, and remember that per-app split tunneling intentionally lets excluded apps use ordinary networking.

iPhone and iPad

Remove obsolete DNS configuration profiles, content filters, or other VPN profiles that compete with the active service. Test Safari and another browser. iCloud Private Relay is not a replacement for a full-device VPN: it primarily protects Safari web browsing and DNS resolution through Apple’s relay design, and availability varies by region and network.

Linux

Determine which component owns DNS—systemd-resolved, NetworkManager, resolvconf, the VPN client, or a local resolver such as dnsmasq. Do not permanently overwrite /etc/resolv.conf if it is generated by another service.

resolvectl status resolvectl query example.com ip -4 route ip -6 route

Verify the VPN interface owns the intended default route and DNS scope. With manual WireGuard/OpenVPN profiles, use the distribution’s supported DNS integration or the provider’s native app.

Routers, smart TVs, and consoles

A router VPN must push or enforce protected DNS for connected clients; otherwise clients may retain ISP/router or hard-coded resolvers. Smart DNS is not a VPN and is not designed to encrypt or hide all traffic. Surfshark discontinued its legacy SmartDNS service in February 2026, so old TV configurations should be returned to automatic DNS or migrated to a supported VPN/router setup.

Still troubleshooting access rather than privacy? DNS failure, geo-blocking, and a true leak can look similar. See how to unblock websites with VPNs or proxies before changing multiple network layers at once.

Try Surfshark’s Native VPN Apps →

Make protection durableDNS Leak Prevention Checklist

ControlRecommended settingWhy it matters
VPN applicationCurrent native app from providerIntegrates routing and DNS with the platform
DNS selectionAutomatic/provider DNS unless documented otherwiseAvoids competing resolver overrides
Kill switchSystem-wide; always-on for higher riskBlocks transition leaks
IPv6Supported inside tunnel or explicitly blockedPrevents fallback outside an IPv4-only tunnel
Browser DoHKnown, tested configurationBrowsers may bypass OS resolver policy
Split tunnelingOff while testing; exclusions documentedSeparates intended bypass from leaks
Testing cadenceAfter updates, new networks, or config changesRouting behavior can change
Evidence captureSave baseline, VPN server, time, screenshots, platformMakes support escalation reproducible

For the wider privacy picture, read how VPNs work and our evidence-based guide to VPN logging policies.

Documented protection modelsVPN DNS Leak Protection Comparison

This table compares published DNS designs, not an unrepeatable “leak rate.” Protection still depends on app version, platform, protocol, split-tunnel choices, and the network used.

VPNPublished DNS approachIPv6 / routing noteConfiguration caution
SurfsharkAssigns Surfshark DNS after connection and routes requests through the encrypted tunnelClaims DNS, IPv6, and WebRTC safeguards in native appsIts SmartDNS service ended Feb. 2, 2026; remove legacy TV settings
Proton VPNOwn DNS resolvers; firewall/platform rules aim to keep DNS on VPN interfaceFull IPv6 support or IPv6 prevention varies by platformProton warns global third-party DNS can override protections
ExpressVPNPrivate DNS runs on each VPN server within TrustedServer architectureBuilt-in IP, DNS, and WebRTC safeguards documentedSplit tunneling has had a remediated Windows DNS issue; keep apps updated
NordVPNNative apps automatically select NordVPN private DNS when connectedProvider DNS addresses are available for manual/third-party setupsManual clients need correct DNS and kill-switch integration

Vendor documentation describes intended behavior; it is not a substitute for testing on your own device. A 2024 Nettitude review documented and retested remediation of an ExpressVPN Windows split-tunneling DNS issue—an example of why current versions and transition testing matter.

Common questionsDNS Leak FAQ

How can I tell whether a DNS server is my ISP’s?

Run a disconnected baseline and record the resolver organization and location. Reconnect the VPN and compare. WHOIS labels can reflect a data center or upstream network, so confirm with the VPN’s documentation and a second test rather than relying on the displayed brand alone.

Is Google or Cloudflare DNS in a result automatically a leak?

No. A browser or OS may intentionally use a public DoH/DoT resolver, and the connection may still travel through the VPN. Investigate whether that resolver received your real IP or the VPN exit IP and whether using it matches your intended privacy policy.

Should I disable IPv6 to stop DNS leaks?

Only as a documented workaround after proving incomplete IPv6 handling. A better fix is a VPN that tunnels IPv6 correctly or blocks it reliably. Blindly disabling IPv6 can break services and conceal a provider defect.

Does HTTPS hide DNS queries?

Website HTTPS encrypts the web connection after name resolution; it does not automatically encrypt classic DNS. DoH and DoT encrypt the DNS transport. A VPN can also protect classic DNS by carrying it inside the encrypted tunnel.

Does DNS over HTTPS prevent VPN DNS leaks?

It prevents observers between the client and DoH resolver from reading the query. Whether it prevents a VPN leak depends on route: DoH through the VPN can be compatible; DoH outside it may expose your real source IP to the resolver and bypass provider policy.

Can split tunneling cause DNS leaks?

It can create intentional non-VPN DNS paths for excluded apps or destinations. That is not necessarily a bug, but apps can behave inconsistently if their web traffic and DNS follow different routes. Test excluded and included apps separately.

How often should I test?

Test after installing or updating the VPN, changing protocol or DNS settings, enabling split tunneling, adding a security app, or using a new network. Higher-risk users should also test sleep/wake, roaming, and forced reconnect behavior.

What if the leak persists in the provider’s current native app?

Capture the platform, app version, VPN protocol/server, network, baseline and connected results, browser settings, and transition steps. Send that evidence to security/support. If a reproducible full-tunnel leak remains unresolved, stop relying on that setup and change provider.

Bottom Line

A DNS test is a clue, not a verdict. Establish a baseline, compare browsers and the OS, test IPv4 and IPv6, and probe reconnect transitions. The most reliable setup is usually the provider’s current native app with automatic/provider DNS, system-wide kill-switch protection, and no untested resolver override.

DoH and DoT improve DNS transport privacy, but they do not replace a VPN or prove the resolver stayed inside its policy boundary. Diagnose the path first; fix only the layer that failed.

Disclosure: This article contains affiliate links. Purchases may earn us a commission at no extra cost to you. Affiliate relationships do not change the test method or comparison criteria. Product behavior can vary by platform and update; verify current documentation.

Sources & comparison methodology

We reviewed standards, current OS/browser behavior, Android VPN APIs, vendor documentation, and a published remediation report. We removed unrelated breach counts and unsupported market-wide leak percentages because they did not measure current DNS behavior across comparable products.

  • IETF: RFC 8484 (DoH), RFC 9076 (DNS privacy considerations), and RFC 8932 (DNS privacy service recommendations).
  • Browsers and operating systems: current Google Chrome Secure DNS help; Mozilla Firefox DoH protection and network-detection documentation; Microsoft Windows DNS encryption, VPN NRPT, and VPN profile documentation; Android VpnService.Builder API; Apple Private Relay and encrypted DNS deployment documentation.
  • VPN providers: Surfshark DNS assignment, connection testing, VPN security, and SmartDNS retirement support pages; Proton VPN DNS leak documentation; ExpressVPN private DNS/features and Nettitude remediation report; NordVPN private DNS support documentation.
  • Method: a “leak” requires an unintended path or resolver relative to the promised configuration. Provider claims are labeled as published behavior. The diagnostic chart visualizes completeness and is explicitly not a prevalence estimate.

Research cut-off: September 21, 2026. Test instructions favor native inspection commands and comparative states; no single commercial test site is treated as authoritative.

Share this:

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *