AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

i365Finds Editorial is the independent research and editorial organization behind 365 Wiki. We follow changes in tools, products, services, entertainment, and digital life around the world, turning scattered and fast-moving information into clearly sourced, well-structured public content that is easier to understand and compare.
Indexed 89,154 Wiki articles

Why Browser DNS-over-HTTPS Overrides VPN DNS and Leaks Your Location

前山千鶴 · 365Finds Editorial

Enabling every security toggle in your settings feels like the responsible thing to do. We see this constantly at 365Finds: a privacy-conscious user subscribes to a reputable VPN, boots it up, opens their browser, and turns on "Secure DNS" or DNS-over-HTTPS (DoH). It seems logical. More encryption must equal more privacy.

It doesn't.

Instead of reinforcing your defenses, turning on browser-level DoH while connected to a system VPN creates an architectural clash. Your browser quietly circumvents the encrypted tunnel's internal resolver, sends name resolution out through third-party public resolvers, breaks CDN geo-routing, and leaves a conspicuous breadcrumb trail that defeats the very anonymity you paid for.


The Root Cause: System Socket Resolvers vs. Application-Layer HTTPS

To understand why this happens, you have to look at where name resolution actually occurs in your operating system stack.

Standard System VPN DNS Flow:
[ Web Browser ]
      │ (OS socket API: getaddrinfo)
      ▼
[ OS Network Stack ]
      │ (Bound to Virtual TUN/TAP Adapter)
      ▼
[ Encrypted VPN Tunnel ]
      │ (UDP/TCP Port 53 routed through tunnel)
      ▼
[ VPN Egress Node & Internal DNS Resolver ] ───> [ Authoritative Nameserver ]

Browser DoH Conflict Flow:
[ Web Browser (DoH Active) ]
      │ (RFC 8484: Encapsulated HTTPS POST/GET over Port 443)
      ├── [ Bypasses OS getaddrinfo & System Adapter Settings ]
      ▼
[ Public DoH Resolver (Cloudflare / Google / Quad9) ]
      │ (Queries CDN via EDNS Client Subnet / Resolver Location)
      ▼
[ Authoritative CDN Nameserver ] ───> Returns Edge IP Mismatched to VPN Egress

The System VPN Model

When you connect to a VPN client on Windows, macOS, Linux, iOS, or Android, the software creates a virtual network interface (such as a TUN/TAP or Wintun adapter) and adjusts the operating system's routing table.

Under normal circumstances, whenever an application needs to resolve a domain like example.com, it invokes standard operating system socket library calls—such as getaddrinfo on POSIX systems or DnsQuery_A on Windows. The OS directs this query to the DNS server assigned to the active network adapter. In a properly configured VPN, that adapter points strictly to an internal, private DNS resolver (often a local IP like 10.x.x.1 or 100.x.x.1) located at the VPN exit node.

Every DNS request is encrypted within the VPN tunnel and resolved at the exact same geographical egress point as your web traffic. Your ISP sees nothing, external observers see queries coming from the VPN server's IP, and your identity stays blended within the crowd.

How Browser DoH Breaks the Chain

DNS-over-HTTPS (standardized under RFC 8484) was not built for VPN users. It was conceived by browser vendors like Mozilla and Google to protect everyday web users whose unencrypted port 53 DNS queries were routinely snooped on, hijacked, or censored by ISPs and malicious local Wi-Fi networks.

To accomplish this, browsers like Google Chrome, Microsoft Edge, Brave, and Mozilla Firefox embedded their own internal DNS stub resolver directly inside the application.

Instead of handing the query off to the operating system's socket APIs, the browser formats the DNS request into an HTTP packet and transmits it over standard TLS (port 443) directly to an external DoH provider—such as Cloudflare (1.1.1.1), Google Public DNS (8.8.8.8), or Quad9 (9.9.9.9).

To your operating system and network interface, this traffic does not look like DNS. It looks like ordinary, encrypted web browsing over port 443. As a result:

  1. The browser completely ignores the VPN adapter's DNS settings. The local loopback or tunnel resolver provided by the VPN client is never queried.
  2. The VPN's DNS-based blocking is crippled. If your VPN provides built-in ad, tracker, or malware filtering (such as Mullvad DNS, Proton NetShield, or IVPN AntiTracker), browser traffic skips these safeguards entirely.
  3. Control shifts from your chosen VPN to a third-party tech giant. You chose a VPN to avoid corporate surveillance, yet your browser hands your entire real-time lookup stream directly to Google or Cloudflare.

How Browser DoH Triggers DNS Location Leaks and CDN Conflicts

When you run a leak test on a site like dnsleaktest.com with browser DoH active, you will often see servers from Cloudflare or Google located in your home city, even while your VPN IP claims you are sitting in Amsterdam or Tokyo.

This is not a rendering glitch. It is a genuine routing and privacy failure.

1. EDNS Client Subnet (ECS) and Physical IP Exposure

Traditional DNS queries do not contain the client's IP address when forwarded to authoritative nameservers; the authoritative server only sees the recursive resolver's IP. However, because public Anycast resolvers like Google Public DNS serve queries globally, they often implement RFC 7871 (EDNS Client Subnet, or ECS).

ECS inserts a truncated portion of the requester's IP address (typically a /24 prefix for IPv4, revealing your neighborhood or ISP exchange) into the query sent to authoritative nameservers.

If your browser's DoH connection bootstraps or resolves before your VPN tunnel is fully initialized—or if you utilize split tunneling where browser HTTPS traffic is directed outside the tunnel—the DoH resolver receives your genuine residential IP. That IP (or its subnet) is then forwarded straight to authoritative nameservers. The VPN tunnel might be encrypting your payload, but your physical locality has already been broadcast.

2. CDN Anycast Routing Divergence and "Hairpinning"

Modern Content Delivery Networks (CDNs)—such as Akamai, Fastly, and Cloudflare—deliver media and web assets from edge servers located as close to the user as possible. To determine which edge server IP to return, the CDN looks at the source of the incoming DNS query.

When browser DoH is active alongside a VPN, a severe geographical mismatch occurs:

ComponentStandard VPN BehaviorVPN + Browser DoH Conflict
DNS Request RouteTraverses encrypted tunnel to VPN internal DNSSent over HTTPS to public DoH resolver (e.g., Cloudflare/Google)
Resolver Egress PointExact same data center / ASN as the VPN exit nodeAnycast node nearest to the DoH connection entry point
CDN Target ReturnedOptimized for the VPN exit node's IP and regionOptimized for the third-party DoH resolver's location
Web Traffic EgressDirect hop from VPN exit node to local CDN edgeVPN exit node forced to connect to distant CDN edge server
User ImpactOptimal latency; matching geolocationHigh latency; connection drops; anti-bot challenges; CAPTCHAs

Consider a concrete scenario. You connect your VPN to a server in Frankfurt to access regional European services. However, your browser's DoH resolver directs queries through an Anycast cluster that routes through London or back to your physical ISP's nearest metro hub.

The CDN's authoritative DNS returns an IP address for an edge server in London. Your browser then establishes an HTTPS connection to that London IP—but it routes the connection through the Frankfurt VPN server.

This routing detour, often referred to as "hairpinning," adds unnecessary latency. Worse, sophisticated fraud prevention and geo-fencing systems see an incoming TCP connection from a German data center IP requesting resources from a regional edge server assigned via a British or North American DNS resolver. To automated security filters, this discrepancy is an immediate hallmark of automated scraping, credential stuffing, or VPN proxy usage, triggering aggressive Cloudflare Turnstile screens, Google reCAPTCHAs, or immediate access blocks.

3. Destruction of the Anonymity Set

The fundamental mechanism behind VPN privacy is the "anonymity set." When hundreds or thousands of users share a single VPN server and its designated internal DNS resolver, their individual traffic blends together. An external observer monitoring outbound DNS requests cannot distinguish User A's queries from User B's queries.

When you configure your browser with custom DoH inside a VPN session, you destroy this parity.

You become the lone user on that VPN node whose browser queries an independent DoH endpoint. If you use a custom NextDNS or AdGuard profile containing specialized filter lists, your DNS query profile becomes completely unique. Far from making you invisible, you have created a persistent, distinct fingerprint.


How to Fix It: Disabling Browser DoH for VPN Coherence

At 365Finds, our position on this is clear: if you run a trusted, system-level VPN, browser-level DoH should be turned off.

Your VPN already encrypts all outbound traffic—including standard port 53 DNS queries—inside an encrypted tunnel (WireGuard, OpenVPN, or IKEv2). Running DoH inside that tunnel provides no additional confidentiality from your ISP, while actively stripping the VPN of its ability to manage routing and leak prevention.

Here is how to revert your browser to standard system DNS resolution.

Google Chrome & Chromium-based Browsers (Brave, Vivaldi)

  1. Open Chrome and paste chrome://settings/security into the address bar.
  2. Scroll down to the Advanced section.
  3. Locate Use secure DNS.
  4. Toggle the switch to Off. (Alternatively, if you must leave it on for non-VPN sessions, select "With your current service provider" rather than choosing a custom provider like Cloudflare or Google. This forces Chromium to query the OS stub resolver rather than hardcoded public endpoints.)
Settings > Privacy and security > Security > Use secure DNS > [OFF]

Mozilla Firefox

Firefox was the earliest aggressive adopter of DoH, and its Trusted Recursive Resolver (TRR) settings are particularly assertive.

  1. Open Firefox and navigate to about:preferences#privacy.
  2. Scroll to the very bottom to the DNS over HTTPS section.
  3. Select Off (Default protection / OS resolver).

For advanced users who want to guarantee Firefox never attempts DoH under any circumstances:

  1. Type about:config in the address bar and accept the risk prompt.
  2. Search for network.trr.mode.
  3. Set the integer value to 5 (TRR disabled completely; strictly use the native OS resolver).
about:preferences#privacy > DNS over HTTPS > Select "Off"
- or -
about:config > network.trr.mode = 5

Microsoft Edge

  1. Open Edge and navigate to edge://settings/privacy.
  2. Scroll down to the Security heading.
  3. Locate Use secure DNS to specify how to lookup the network address for websites.
  4. Toggle the setting to Off.
Settings > Privacy, search, and services > Security > Use secure DNS > [OFF]

Verifying Your DNS Configuration

Once you have disabled browser DoH, you must verify that your system is behaving cohesively:

  1. Connect to your VPN.
  2. Open your web browser and visit https://www.dnsleaktest.com or https://ipleak.net.
  3. Run the Extended Test.
  4. Inspect the resulting IP addresses, Hostnames, and ASNs of the DNS servers:
    • Correct Result: All detected DNS servers belong to your VPN provider's autonomous system (ASN) and share the geographic vicinity of your VPN exit server.
    • Leaking Result: You see servers belonging to Cloudflare, Google, your local telecom ISP, or a country completely different from your VPN exit node.

Security tools should work in harmony, not against each other. When you strip away redundant browser-level overrides and allow your VPN to handle DNS natively, you restore unified routing, eliminate CDN geo-mismatches, and keep your anonymity intact.


References