October 21, 2026 · Troubleshooting · About 8 min

V2Ray DNS Leak Tests and DNS Configuration to Prevent Leaks

Learn what causes DNS leaks, how to test for them, and how to configure remote DNS, direct DNS, and routing rules in your client so DNS queries follow the intended traffic route.

At a Glance

Is your proxy connected, but a test page still shows your ISP's DNS resolver? Compare browser lookups, system queries, and core logs, then check DNS groups and resolver outbound routing separately. This guide helps v2rayN users troubleshoot split tunneling and explains which system settings to check when retesting on Android.

A DNS Leak Means Queries Take an Unexpected Route

Routing web traffic through a proxy doesn't mean DNS queries use it too. An app may query the system resolver first, then send the resulting IP address through the proxy. Alternatively, it may pass the domain name to the proxy and let a downstream resolver look it up. Browsers can also send encrypted DNS requests of their own. To determine whether a query is leaking, first specify which resolver should handle each domain and which outbound route its queries should take.

App domain requestQuery interceptionDNS rule matchingResolver outbound routeAddress response

A system proxy mainly affects apps that honor the proxy settings; it doesn't automatically handle all system DNS queries. TUN can capture more traffic, but whether regular DNS reaches the core still depends on virtual adapter routing and DNS interception rules. Don't check only UDP when looking for regular DNS: some queries use TCP, for example when a truncated UDP response triggers a retry.

53
Common ports for regular DNS (UDP/TCP)
853
Default port for DNS over TLS (TCP)
443
Default HTTPS port for DNS over HTTPS

Bottom line: ports can narrow down the search

If the logs show no direct regular DNS traffic but test results still look wrong, check whether Secure DNS is enabled in the browser, then review the outbound route for encrypted DNS connections. Port 443 alone doesn't prove that a connection is carrying DNS.

Establish a Baseline Before Testing the Proxy

Test pages typically generate a random subdomain and use observations from authoritative DNS servers to list the recursive resolvers that made the query. They don't show the entire path between your device and the resolver, and the resolver's IP isn't necessarily the same as your web traffic's exit IP. A resolver's operator or location differing from the proxy exit doesn't by itself prove a leak.

  1. Set a Baseline

    On a trusted network, pause the proxy and run a reputable DNS test in the same browser. Record the resolver IP, provider, and test time. Use only the domain generated by the test page; don't test with work or private domains. If company device policies prevent pausing the proxy, compare against a known network configuration instead.

  2. Retest One Mode at a Time

    Start with system proxy only. Confirm the browser's web traffic exits where expected, then run a fresh test. To check TUN, run a separate test and record the adapter, proxy node, and browser Secure DNS status. Don't switch networks and nodes at the same time, or you won't know what caused the difference.

  3. Check the System Separately

    On Windows, run the command below in a terminal to see the default server used for a system-level query. The result may point to a local forwarder and won't show the browser's Secure DNS path. Check the client logs to see whether the core handled the query.

  4. Compare the Logs

    Use the test timestamp to find DNS queries, upstream connections, and outbound routing records. If the current logs don't show a particular step, don't assume the query used the proxy just because there's no record. First check the app's DNS settings and the configuration actually loaded by the core, then verify with another random query.

nslookup example.com

Remote DNS, Direct DNS, and Outbound Routing

In the v2rayN main window, check the active mode under Settings → Parameter Settings, then look under Settings for DNS Settings or Custom DNS Settings. Menu names, fields, and configuration formats vary by release and core. If the interface only provides a custom configuration editor, don't paste in fields meant for a different core. Save your current DNS, routing, and node settings first so you can revert one change at a time.

Query targetResolverOutbound route and constraints
Domains that should use the proxyConfigure as remote DNSRoute the upstream connection through the proxy; don't fall back to a local resolver if it fails
Public domains that should connect directlyConfigure as direct DNSConnect directly to a trusted resolver; put specific direct rules before broad catch-all rules
Internal work or home domainsUse the resolver provided by the relevant networkResolve only on that network; don't send private domains to public upstreams
Proxy node hostnameSpecify a separate, working bootstrap resolution pathDon't rely on the same proxy connection that hasn't been established yet

Check two separate sets of rules: one determines which DNS upstream receives a query for a domain; the other determines the outbound route to that upstream. A field labeled remote DNS doesn't guarantee that the connection takes a remote route. If the upstream connection matches a direct rule, the query still goes out directly. Conversely, routing all resolver connections through the proxy can prevent the proxy from connecting if it needs DNS to resolve the node first. If an encrypted DNS upstream is specified by hostname, also check how that hostname is resolved the first time. Don't disable certificate verification as a shortcut.

Common Errors and How to Revert Changes

Resolution failures and DNS leaks are different problems. For a resolution failure, find the query that didn't get a usable response. For a leak, find out which resolver answered and which route the query took. If websites stop loading after a DNS change, save the target and timestamp from the logs, then diagnose the specific error.

Error: i/o timeout

Cause: If this appears in the upstream DNS connection logs, the connection may be unreachable or its response may have timed out. Fix: Check the destination address and port, restore the last working upstream, then check the outbound route matched by the new upstream.

Error: no such host

Cause: If this appears immediately after a node hostname, the current bootstrap resolution path may be returning a nonexistent result, or the hostname may be incorrect. Fix: Check the hostname in the subscription, compare it using the previously working resolution path, and rule out a circular dependency where the node must connect before it can be resolved.

Reload the core and make a fresh query after each change; don't rely on whether a previously opened page still loads. Test at least one domain expected to use the proxy and one expected to connect directly. To check coverage across the device, also test other apps you actually use and the IPv6 path. If results change after switching networks, note which app or query path changed instead of simply disabling IPv6. Keep the final working configuration and comparison results, and retest under the same conditions after updating the subscription or changing modes.

Clients and Setup Guides

Choose a download for your operating system, then follow the guide to check system proxy and subscription settings.

Go to Downloads View Setup Guide
v2rayN Download and Platform Options