A working proxy connection doesn't mean DNS queries are taking the expected route. If you're using the system proxy on desktop or still see your local resolver after connecting on Android, compare results in the same app with the client off and on. Then check DNS settings in the browser, client, and operating system. Change one setting at a time to pinpoint the cause.
First, identify which queries should not connect directly
A DNS leak occurs when a domain lookup that should go through the proxy takes an unexpected route. For example, a browser's web traffic may use the proxy while an app first asks your local router to resolve a domain, then connects to the resulting IP address. Conversely, if your routing rules explicitly send local network domains to the local resolver, seeing those queries connect directly does not mean proxied domains are leaking.
- System proxy: Only affects apps that honor proxy settings. If an app resolves a hostname through the system resolver first, or sends DNS requests on its own, enabling the system proxy won't automatically reroute either type of query.
- TUN or Android VPN: Captures more traffic, but behavior still depends on capture scope, app exclusions, and routing rules. Captured connections may still be routed directly by a rule, so the enabled status alone is not proof.
- Encrypted DNS: DoH typically uses HTTPS over port 443, while DoT typically uses TCP port 853. Traditional DNS usually uses UDP port 53, but can also use TCP port 53. Encryption describes how queries are transported, not whether the connection uses the proxy.
Run a repeatable DNS comparison test
Use a DNS test page that generates a fresh query domain for each run and lists the recursive resolvers it detects. When using a public test service, don't submit subscription links, node credentials, or internal domain names. Reopening an ordinary webpage may use a cached result, so it doesn't prove that a new query was sent.
Record a direct-connection baseline
On a network where direct access is allowed, disconnect the client and run a test in the same browser. Record the public IP, the resolvers listed by the test page, and the browser's Secure DNS status. On Android, also note whether Private DNS is enabled.
Change only the proxy mode
Connect the client and keep the browser settings unchanged, then run a fresh test query. On desktop, test the system proxy first and TUN separately. On Android, start with a browser included in the VPN, then check the app where the issue actually occurs.
Trace the resolution path
Compare the test time with the client logs and look for a matching DNS query or proxy outbound record. If you can inspect your device's network traffic, check for requests to port 53 on the local gateway, but don't mistake background queries from other apps for the test query.
Retest the app you actually use
After the browser test passes, check whether your everyday apps use the same capture path. If an app can't load the test page, use its own network diagnostics or the client logs to verify its traffic. Don't assume the browser's result applies to other apps.
| Test result | What it tells you | Next step |
|---|---|---|
| The egress IP changed, but the resolver did not | This alone doesn't confirm a leak. Both routes may use the same public resolver. | Check the provider configured for the browser's Secure DNS and which outbound connection it uses. |
| The test domain was sent to the gateway on port 53 | If this domain should be resolved through the proxy, this record supports a local bypass diagnosis. | Check whether the app resolved the domain early, then review capture scope and direct-connection rules. |
| No port 53 traffic observed | This doesn't prove all DNS uses the proxy; the result may be cached or encrypted DNS may be in use. | Run a fresh query and check which outbound connection the resolver uses. |
In short: resolver location is only a clue
Don't judge a leak by the resolver's country or region. First identify the outbound connection used by the query. If you can only see the resolver list returned by the test site, treat the result as inconclusive.
v2rayN: Remote DNS, Routing, and TUN
First note the current core type and routing setup. The same option can generate different configurations with different cores, and a custom configuration may define its own DNS settings. Don't assume values entered in the client UI will override those settings. The steps below refer to common screens in v2rayN 7.x; menu names may vary slightly between minor releases.
- Configure resolution first, then check the outbound route. In the main window, go to “Settings” → “DNS Settings” and choose the configuration for your current core. Enter a trusted remote resolver in a format supported by that configuration. Check that connections to the DNS service use the expected outbound route; changing the server address alone won't send DNS traffic through the proxy. If the service address is a hostname, also make sure it can be resolved initially.
- Separate DNS server selection from connection routing. Under “Settings” → “Routing Settings,” review the active profile and make sure a broad direct-connection rule doesn't match first. In Xray routing,
AsIsdoes not resolve domains to match IP rules;IPIfNonMatchattempts resolution when a domain doesn't match;IPOnDemandtriggers resolution when needed to match an IP rule. These values control when routing uses IP addresses; they don't determine which outbound connection carries DNS traffic. - Enable TUN only if you need to capture more apps. Turn on “TUN Mode” at the bottom of the main window and grant the requested permissions. When retesting, avoid changing other settings along with the system proxy, and test each mode separately if possible. If public DNS works again but local network names stop resolving, check whether local DNS needs to remain available separately. Don't send every internal hostname to a remote resolver.
v2rayNG: Check VPN Coverage and Android DNS
The Android VPN created by v2rayNG is not the same traffic entry point as the desktop system proxy. Even when the VPN icon appears in the status bar, apps excluded from per-app proxying may bypass it. First confirm that the affected app is covered, then investigate whether the remote DNS settings are the cause.
- Open the top-left menu and go to “Settings” → “Per-app proxy.” Check whether the current list means only selected apps are proxied or selected apps are bypassed. Seeing a browser in the list doesn't necessarily mean it will use the proxy.
- Under “Settings,” check “Remote DNS” and “Direct DNS.” If your version offers “Enable local DNS,” read its description to confirm whether the client handles queries. Don't assume from the field name that every app will use that resolver. Save your changes, disconnect, reconnect, and test a fresh domain.
- Check Android's “Private DNS” setting. A common path is “Settings” → “Network & internet” → “Private DNS”; if your device's menus differ, search for the setting by name. If the browser also has Secure DNS configured, note both settings and test them one at a time. Restore your preferred encrypted DNS settings afterward.
- If the problem occurs only after switching networks, test Wi-Fi and mobile data separately. Keep the same node, app, and routing profile to isolate differences in network access. Don't reset the node, DNS, and per-app list at the same time.
No connection after changing DNS? Roll back based on the error
A timeout in the logs could come from the node, the resolver, or the connection route. Check the destination and outbound records around the same time before reverting DNS; the last line of an error alone isn't enough to identify the cause.
Error: i/o timeout
Cause and fix: The request didn't complete before the deadline, which doesn't necessarily mean the resolver is at fault. If the record points to a remote DNS service, retest with the previous settings, then check which protocol, port, and outbound route the new service requires.
Error: no such host
Cause and fix: The lookup couldn't find the target host. Possible causes include a misspelled name, an internal domain sent to a public resolver, or a failed initial lookup for the node's hostname. First identify the name that failed in the logs, then restore the appropriate local or bootstrap resolution path.
- If the proxy needs to resolve a node's hostname before it can connect, but that lookup is routed through the proxy that has not connected yet, a dependency loop can occur. Test bootstrap resolution for the node separately from everyday proxied domain lookups.
- Before wrapping up, test a fresh domain, access through the app you actually use, and local network access. Note the client version, core type, current mode, and time of the issue. Remove subscription URLs and connection credentials before sharing logs.