Gologin
← Blog

What Is a DNS Leak? Mechanics, Detection & Prevention

A DNS leak occurs when a hostname lookup uses a resolver or network path outside the proxy, VPN, or privacy boundary the user intended. When a browser or application resolves a domain name through a local ISP or unencrypted system resolver while web traffic passes through an encrypted tunnel or proxy, the name-resolution path can expose requested domain names, regional metadata, and resolver identities to network observers and anti-fraud engines.

A conventional browser proxy handles selected application connections; it does not automatically replace operating-system routes, network interface metrics, or global DNS configurations. Understanding how DNS queries travel across operating system layers and proxy protocols is essential for configuring leak-free browsing environments.

Guide to Stopping DNS Leaks

1. How DNS Resolution and Proxy Routing Work

A typical browser navigation request follows a distinct execution flow before establishing a web connection:

  1. Hostname Request: The browser receives a target domain name (e.g., example.com).
  2. Cache Check: The browser checks its internal cache, the operating system DNS cache, and any active secure-DNS caches.
  3. Resolver Path Selection: If uncached, a resolver path is selected, such as the operating system resolver, a browser-managed DNS-over-HTTPS (DoH) provider, or a proxy-aware remote resolution path.
  4. Address Resolution: The resolver fetches IP addresses (IPv4 A records or IPv6 AAAA records.
  5. Socket Execution: The browser connects directly or instructs a configured HTTP, HTTPS, or SOCKS proxy to open the socket.

Proxy selection, DNS resolution, and IPv4/IPv6 route selection are separate decisions. A leak occurs when name resolution bypasses the intended proxy or VPN egress path.

Local vs. Remote Proxy DNS Resolution

Understanding where hostname resolution takes place is critical for identity isolation:

  • Local DNS Resolution: The browser or operating system resolves the domain name before initiating the connection. The client then hands a numeric IP address to the proxy. This exposes the requested domain name to the local network or ISP resolver and deprives the proxy of hostname context.
  • Remote Proxy DNS Resolution: The client preserves the target domain name and passes it directly to the proxy. SOCKS5 explicitly supports a domain-name address type in connection requests, while HTTP proxies accept hostnames via absolute-form requests or the CONNECT target authority. The proxy resolves the domain on its own network.

Remote resolution reduces local DNS exposure, but it must be paired with controls over speculative prefetching, background networking, browser DoH, and socket fallbacks.

2. How DNS Queries Bypass the Intended Path

Windows Smart Multi-Homed Name Resolution (SMHNR)

On multi-homed Windows devices, the DNS Client service may optimize name resolution by dispatching parallel queries across multiple active physical or virtual network interfaces (e.g., Wi-Fi, Ethernet, and VPN adapters). The OS accepts responses based on policy and network interface binding order. A conventional browser proxy is an application-level setting, not a network adapter, and is not queried by SMHNR.

Dual-Stack IPv4 and IPv6 Routing Behaviors

Dual-stack networks introduce two independent bypass vectors:

  • IPv6 DNS Leak: The DNS query packet itself reaches an unintended resolver over an IPv6 network route.
  • Direct IPv6 Connection Leak: The browser requests an IPv6 AAAA record and opens a direct connection over IPv6 because the configured proxy or VPN captures only IPv4 traffic.

Requesting an AAAA record does not mean the DNS query was transported over IPv6. Both the resolver path and outbound socket routing must be governed by a fail-closed policy.

DNS Leak test

Fallback Resolvers and Secure DNS (DoH / DoT)

DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) encrypt queries between the client and the resolver endpoint, preventing eavesdropping on the local wire. However, encrypted DNS requests sent directly to a public DoH provider (like Cloudflare or Google) through the local network still bypass an active proxy tunnel. If DoH fails or times out, browsers may silently fall back to system resolvers.

Practical Leak-Path Comparison

Leak Path How It Occurs Technical Reality
Local System Resolver Browser resolves hostnames locally using OS/DHCP settings before proxying. HTTP traffic is proxied, but domain requests remain visible to the local network/ISP.
Browser DoH Browser contacts DoH endpoints directly over the local network interface. Query content is encrypted, but DNS travels outside the intended proxy path.
Windows SMHNR OS queries multiple network adapters in parallel. Applies to network adapters (VPN/Wi-Fi), not application-level proxies.
IPv6 Resolver Path DNS packets travel across an uncaptured IPv6 network route. A true DNS leak over the IPv6 transport layer.
Direct IPv6 Egress Browser connects directly to an IPv6 destination bypassing an IPv4 proxy. A socket routing bypass, not a DNS leak.

3. Disambiguating Leak Types: DNS vs. WebRTC vs. WebSockets vs. TLS

Security issues are often conflated into a generic “IP leak” category. However, these mechanisms operate over different protocols and reveal different metadata:

Mechanism Protocol Level Exposed Data Key Distinguishing Factor
DNS Leak UDP/TCP Port 53, 853, or HTTPS Requested hostnames, resolver identity, ISP/regional metadata. Exposes the name-resolution path.
WebRTC Exposure ICE / STUN / TURN Candidates Local interface IPs, public NAT addresses, peer paths. Concerns real-time media candidate discovery, not DNS.
WebSocket Bypass TCP (ws:// or wss://) Direct source IP and destination socket connection. A proxy-routing failure where socket policy permits direct fallback.
TLS Metadata TLS ClientHello (SNI) Destination server name (when ECH is disabled). Exposes destination metadata on active connection paths.

4. How Websites Detect DNS Leaks (Authoritative Correlation)

Websites cannot directly query browser JavaScript to inspect a visitor’s recursive DNS resolver. Instead, security platforms and leak-test sites use Authoritative DNS Correlation:

  1. The webpage triggers an HTTP request or image load from a dynamically generated, unique subdomain (e.g., a1b2c3.leak-test.com).
  2. The visitor’s browser attempts to resolve a1b2c3.leak-test.com.
  3. The test platform’s authoritative DNS server logs the IP address and ASN of the recursive resolver that requested the record.
  4. The web server compares the IP address of the incoming web request against the IP address of the recursive resolver.

A mismatch between the web egress location and the resolver location indicates an inconsistent network profile. However, because public DNS providers utilize Anycast networks, shared caching, and EDNS Client Subnet (ECS) extensions, matching a resolver’s ASN or ISP identity provides stronger evidence of a leak than geographical country matching alone.


πŸ’‘ Expert Insight

“One of the most common mistakes I see is treating a browser proxy as if it were a full network tunnel. Operating systems and browsers can resolve names through separate code paths, including the system resolver, browser DNS prefetching, built-in DNS-over-HTTPS, and multi-interface or IPv6 fallback. If HTTP traffic exits through a proxy but DNS still reaches a local ISP resolver, the session loses network consistency: the resolver path may reveal the user’s ISP or region and can be correlated by services that control both web and authoritative DNS infrastructure. Proper mitigation must be fail-closed. The browser should pass hostnames to the proxy for remote resolution, prevent direct DNS and direct socket fallback, control IPv4, IPv6, DoH, WebRTC, and WebSocket paths, isolate caches per profile, and verify the result with controlled DNS and packet-level testing.

Timothy Christian Sumali
Cybersecurity Consultant & CTO at Encripti | Technical Content Reviewer

5. Mitigating DNS Leaks & Gologin Architecture

gologin

Preventing DNS leaks across multi-account profiles requires enforcing strict socket-level routing rules and preventing unproxied fallback.

Best Practices for DNS Isolation

  • Enforce Remote Proxy Resolution: Configure SOCKS5 and HTTP proxy profiles to pass raw hostnames directly to the proxy endpoint.
  • Disable Un-Proxied Fallback: Enforce fail-closed rules so that if a proxy connection fails, the browser does not attempt a direct local connection.
  • Control Secure DNS Settings: Disable or proxy browser-managed DoH endpoints to prevent direct local egress.
  • Govern IPv6 & WebRTC: Ensure IPv6 connections follow the proxy rules or are disabled when proxying over IPv4-only networks. Restrict WebRTC candidate gathering.

How Gologin Eliminates DNS Leaks

DNS Handling in Gologin Profile Architecture

In GoLogin’s Orbita browser, network execution contexts are isolated per profile. Depending on the selected proxy configuration, Orbita aligns hostname resolution with outbound connection settings:

  • Proxy-Side Resolution: For SOCKS5 and supported HTTP proxy setups, domain names are passed directly through the proxy tunnel.
  • Custom DNS Configurations: Users can define custom DNS resolvers per profile to align DNS egress with specific proxy locations.
  • Profile-Isolated Caches: DNS lookup caches are isolated between browser profiles to prevent cross-profile session correlation.

Test Your Network Isolation for Free

Manage isolated browser profiles with remote proxy DNS resolution and fail-closed network controls.

Download Gologin

FAQ: DNS Leaks & Network Isolation

1. What is the primary cause of a DNS leak?

The primary cause is local DNS resolution. When a browser resolves a hostname using the local OS or ISP resolver before handing the resulting IP address to a proxy, the lookup bypasses the proxy path.

2. Does DNS-over-HTTPS (DoH) prevent DNS leaks?

Not automatically. DoH encrypts queries between the browser and the DoH endpoint, preventing local network eavesdropping. However, if the DoH endpoint is contacted directly over the local network rather than through the proxy tunnel, it still constitutes a lookup outside the intended proxy boundary.

3. Why is country matching an unreliable leak indicator?

Many public DNS resolvers use Anycast routing, shared infrastructure, and regional egress nodes. An Anycast resolver might process a query in a neighboring country or region despite serving local users. Matching the resolver’s ASN or ISP identity provides far more reliable evidence of a leak than country-level geolocation alone.

4. How can I test if my browser is leaking DNS requests?

You can test your browser using authoritative correlation tools:

  • BrowserLeaks DNS Test (browserleaks.com/dns) β€” Triggers unique subdomains to display your active recursive resolvers.
  • DNSLeakTest.com β€” Offers standard and extended tests to detect active resolver endpoints.
  • Packet Capture (Wireshark) β€” Inspects network interfaces directly to verify that no raw UDP/TCP port 53 packets exit the local network interface during proxied sessions.