<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ricco020</title>
    <description>The latest articles on DEV Community by ricco020 (@ricco020).</description>
    <link>https://dev.to/ricco020</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3960216%2Fbc01eb94-de65-41c2-9767-966a157976ae.jpeg</url>
      <title>DEV Community: ricco020</title>
      <link>https://dev.to/ricco020</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ricco020"/>
    <language>en</language>
    <item>
      <title>Test a DNS Leak in 2 Minutes: Complete Methodology + Per-OS Fixes (2026)</title>
      <dc:creator>ricco020</dc:creator>
      <pubDate>Sat, 30 May 2026 16:35:23 +0000</pubDate>
      <link>https://dev.to/ricco020/test-a-dns-leak-in-2-minutes-complete-methodology-per-os-fixes-2026-3ocf</link>
      <guid>https://dev.to/ricco020/test-a-dns-leak-in-2-minutes-complete-methodology-per-os-fixes-2026-3ocf</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Testing for a DNS leak takes 2 minutes: connect your VPN, open &lt;a href="https://www.dnsleaktest.com/" rel="noopener noreferrer"&gt;dnsleaktest.com&lt;/a&gt; and run the Extended Test, then check whether the DNS servers detected are your VPN's (not your ISP's). If the resolved DNS belongs to BT, Comcast, Verizon, Movistar — or whichever ISP you'd normally use without a VPN — that's a confirmed leak.&lt;/p&gt;

&lt;p&gt;Three main causes: (1) &lt;strong&gt;VPN without "DNS Leak Protection"&lt;/strong&gt; enabled, (2) &lt;strong&gt;Windows Smart Multi-Homed DNS&lt;/strong&gt; bypassing the tunnel, (3) &lt;strong&gt;Browser with DoH&lt;/strong&gt; enabled separately.&lt;/p&gt;

&lt;p&gt;The fix takes 5 minutes depending on the case — detailed below by OS and browser. NordVPN, ExpressVPN, and Surfshark enable DNS Leak Protection by default since 2023 and pass leak tests in 99% of our audit sessions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why DNS leaks exist — 4 documented technical causes
&lt;/h2&gt;

&lt;p&gt;A VPN encapsulates your traffic in an encrypted tunnel between your device and the remote VPN server. In theory, all requests — including DNS — go through this tunnel. In practice, several system configurations bypass the tunnel specifically for DNS requests. Understanding the four main causes lets you identify which one affects you and apply the right fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause #1 — Windows and Smart Multi-Homed DNS.&lt;/strong&gt; Since Windows 8, Microsoft has implemented &lt;a href="https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-admx-dnsclient" rel="noopener noreferrer"&gt;Smart Multi-Homed Name Resolution&lt;/a&gt; (SMHNR) which sends DNS queries to all active network adapters in parallel, keeping the first answer that arrives. When a VPN is connected, Windows sends the request both to the VPN DNS AND to the ISP DNS via the underlying Wi-Fi/Ethernet interface. If the ISP response arrives first (often the case on LAN), it's used — and the ISP has logged the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause #2 — Browsers with DoH enabled separately.&lt;/strong&gt; Firefox enables DNS-over-HTTPS to Cloudflare 1.1.1.1 by default since 2020. Chrome offers the same. These DoH resolvers completely bypass the system DNS — including the VPN's — unless the browser specifically detects an active VPN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause #3 — VPN without native DNS management.&lt;/strong&gt; Some low-end VPNs don't declare their own DNS servers in the system configuration when the tunnel activates. The OS then continues using whatever DNS servers were set previously — typically the ones pushed by ISP DHCP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause #4 — Unencrypted IPv6.&lt;/strong&gt; Many VPNs only tunnel IPv4 traffic. &lt;a href="https://en.wikipedia.org/wiki/IPv6" rel="noopener noreferrer"&gt;IPv6&lt;/a&gt; — yet active by default on modern ISPs and all current routers — exits directly outside the VPN.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to test for a DNS leak — 3-tool method
&lt;/h2&gt;

&lt;p&gt;The classic method involves visiting a service that tells you which DNS server actually resolved its query. These services work by generating a unique random subdomain (&lt;code&gt;abc123xyz.dnsleaktest.com&lt;/code&gt;), triggering its resolution from your browser, and reading server-side which IP did the resolution. Three trusted third-party tools let you cross-verify results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool #1 — &lt;a href="https://www.dnsleaktest.com/" rel="noopener noreferrer"&gt;DNSLeakTest.com&lt;/a&gt;.&lt;/strong&gt; The reference test since 2008. Procedure: connect the VPN, open the URL, click "Extended Test" (not "Standard" which is insufficient), wait 10-20 seconds. The tool lists DNS servers that responded — typically 2 to 6 different resolvers (modern DNS servers use load-balanced architectures).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool #2 — &lt;a href="https://browserleaks.com/dns" rel="noopener noreferrer"&gt;BrowserLeaks DNS&lt;/a&gt;.&lt;/strong&gt; Complementary test that cross-checks standard DNS, DNS-over-HTTPS, and resolvers detected via WebRTC. Particularly useful for identifying whether the leak comes from the browser (DoH enabled) rather than the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool #3 — &lt;a href="https://www.anonymflow.com/en/tools/dns-leak-test" rel="noopener noreferrer"&gt;AnonymFlow integrated tool&lt;/a&gt;.&lt;/strong&gt; For WebRTC testing specifically (the most frequent leak cause browser-side in 2026), our in-house tool probes WebRTC ICE candidates from your browser and reveals your real IP if a leak exists at that level.&lt;/p&gt;

&lt;p&gt;For all three, the verdict is binary: either the DNS servers detected match a trusted resolver (Cloudflare 1.1.1.1, Quad9 9.9.9.9, NordVPN AS136787, ExpressVPN's internal range...) — or they match your ISP's range, which means a leak.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to fix depending on the detected cause
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Case 1 — VPN with dormant "DNS Leak Protection" option
&lt;/h3&gt;

&lt;p&gt;The most common and simplest case. On NordVPN, Surfshark, ExpressVPN, ProtonVPN, &lt;a href="https://mullvad.net/" rel="noopener noreferrer"&gt;Mullvad&lt;/a&gt;, the anti-leak DNS protection option exists but may be disabled by default on older installations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NordVPN procedure&lt;/strong&gt;: Settings → Connection → Custom DNS Protection → enable "Auto DNS" or "NordVPN DNS".&lt;br&gt;
&lt;strong&gt;Surfshark&lt;/strong&gt;: Settings → Connection → Custom DNS → disable (let Surfshark manage).&lt;br&gt;
&lt;strong&gt;ExpressVPN&lt;/strong&gt;: Preferences → Advanced → DNS Network Lock → verify enabled.&lt;/p&gt;

&lt;p&gt;After activation, restart the VPN (disconnect/reconnect), then re-run the DNSLeakTest. In 95% of cases, the leak disappears at this stage.&lt;/p&gt;
&lt;h3&gt;
  
  
  Case 2 — Windows Smart Multi-Homed DNS
&lt;/h3&gt;

&lt;p&gt;If enabling VPN DNS Protection doesn't suffice and you're on Windows 10/11, the culprit is likely SMHNR. Manual disabling via PowerShell as administrator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-DnsClientGlobalSetting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-SmartMultiHomedNameResolution&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command completely disables SMHNR behaviour. To re-enable later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-DnsClientGlobalSetting&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-SmartMultiHomedNameResolution&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After disabling, reboot the computer. SMHNR won't reactivate until a major Windows update (check after each Windows feature update).&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 3 — Browser DoH
&lt;/h3&gt;

&lt;p&gt;On Firefox: about:config → &lt;code&gt;network.trr.mode = 5&lt;/code&gt; (disable TRR) OR set TRR resolver to your VPN's DoH endpoint.&lt;br&gt;
On Chrome: Settings → Privacy and Security → Security → Use Secure DNS → choose "With" → enter your VPN's DoH endpoint OR turn off entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 4 — IPv6 leak
&lt;/h3&gt;

&lt;p&gt;The cleanest fix: enable the "Block IPv6 traffic" option in your VPN's settings. NordVPN supports IPv6 tunneling since 2024. If your VPN doesn't tunnel IPv6, blocking it entirely is the safest move.&lt;/p&gt;




&lt;h2&gt;
  
  
  Legal implications — what an ISP log actually contains
&lt;/h2&gt;

&lt;p&gt;A DNS leak isn't a "your computer got hacked" event — it's a privacy slow leak: your ISP keeps the list of domains you visit (DNS resolution logs), which they can be compelled to share via legal process. In France, that means &lt;a href="https://en.wikipedia.org/wiki/HADOPI_law" rel="noopener noreferrer"&gt;Hadopi 2.0&lt;/a&gt; provisions and GDPR Article 4 obligations. In the US, the equivalent framework lives under the &lt;a href="https://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act" rel="noopener noreferrer"&gt;DMCA Section 512&lt;/a&gt; and various subpoena provisions. In Spain it's &lt;a href="https://www.boe.es/buscar/act.php?id=BOE-A-2002-13758" rel="noopener noreferrer"&gt;LSSI and ePrivacy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're using a VPN specifically for privacy protection, this matters: your domain history stays logged at the ISP despite the encrypted tunnel. No immediate hacking risk, but a long-term profiling leak.&lt;/p&gt;




&lt;h2&gt;
  
  
  What about WebRTC leaks (the related cousin)
&lt;/h2&gt;

&lt;p&gt;WebRTC leaks deserve their own write-up — and we wrote one alongside this DNS leak guide. The methodology is similar: trigger a peer connection, parse the ICE candidates that come back, and check whether your real IP is being advertised to remote peers. We also published a &lt;a href="https://github.com/your-org/webrtc-leak-detector" rel="noopener noreferrer"&gt;single-HTML-file open source detector on GitHub&lt;/a&gt; (zero dependencies, runs in any browser, 200 lines auditable in 10 minutes).&lt;/p&gt;

&lt;p&gt;For the deeper VPN security audit covering 9 different test vectors — kill switch, DNS leak, WebRTC, IPv6, audit history, jurisdiction, no-log enforcement — see our &lt;a href="https://www.anonymflow.com/en/blog/complete-vpn-security-audit" rel="noopener noreferrer"&gt;complete VPN security audit guide&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Companion tools
&lt;/h2&gt;

&lt;p&gt;We've published two CLI tools on GitHub that automate the detection logic from this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/your-org/dns-leak-detector-cli" rel="noopener noreferrer"&gt;dns-leak-detector-cli&lt;/a&gt;&lt;/strong&gt; — Python CLI, zero dependencies, ASN comparison, IPv6 + SMHNR detection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/your-org/webrtc-leak-detector" rel="noopener noreferrer"&gt;webrtc-leak-detector&lt;/a&gt;&lt;/strong&gt; — Single HTML file, browser-only, no tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are MIT licensed and runnable on a cron job for ongoing monitoring.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anonymflow.com/en/blog/dns-leak-test" rel="noopener noreferrer"&gt;AnonymFlow&lt;/a&gt; — independent VPN/privacy tooling and research. Read our full &lt;a href="https://www.anonymflow.com/en/methodology" rel="noopener noreferrer"&gt;methodology&lt;/a&gt; and the &lt;a href="https://www.anonymflow.com/en/blog/study-vpn-streaming-2026-95-test-sessions" rel="noopener noreferrer"&gt;95-session VPN streaming study&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>vpn</category>
      <category>privacy</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
  </channel>
</rss>
