How to Check for a DNS Leak in a Proxy Setup
A proxy can hide your address from a website while your DNS queries still travel the normal route. Learn how to test for that and fix it.
10 min readUpdated Nov 13, 2026By XPASS Editorial Team

A proxy changes the address a website sees, but that is only one part of what happens when you open a page. Before any connection is made, your device usually looks up the name of the site using DNS. If that lookup goes out the normal way while the page request goes through the proxy, the two halves of the visit take different paths. That mismatch is called a DNS leak. This guide explains why it happens in proxy setups, how to test for it with tools you already have, and how to fix it. It assumes lawful use that respects the terms of the sites you reach and local rules.
What a DNS leak means for a proxy
DNS translates names into IP addresses, as described in the Cloudflare overview of DNS and the original RFC 1035. Your device asks a resolver, which may be your router, your internet provider, your company or a public service, and the resolver answers.
With a proxy, two kinds of traffic exist side by side: the DNS lookup and the actual request. The request is sent to the proxy because you configured it. The lookup is sent wherever the operating system or the client library sends it, which by default is your ordinary resolver. Whether the lookup follows the request into the proxy depends on the client and the proxy type.
Three things can follow from a leak:
- Your local network or resolver sees the names you look up, even though it cannot see page content.
- The answer you get can differ from the answer the proxy would get, because many services return different addresses by region. You may test the wrong server.
- A mismatch between the exit address and the resolver location may stand out to a site that checks for consistency.
A leak does not expose your passwords or page content, and it is not the same as the proxy failing. It is a gap between where you expect lookups to go and where they actually go.

Why leaks happen
Knowing the causes helps you choose the right test.
- Local resolution by the client. With SOCKS5, some clients resolve the hostname themselves and send only an address to the proxy. In curl this is the socks5 scheme, while socks5h sends the name to the proxy. See how SOCKS5 usage differs from HTTP for the background.
- Applications that ignore the proxy. A tool may proxy its main requests but let a helper process, an update checker or a plugin connect directly.
- Browser features. Prefetching, preconnect hints, secure DNS settings and extensions can send lookups through their own path, including a configured DNS over HTTPS provider.
- Operating system services. The system resolver, a local cache and background services keep working independently of the app that uses the proxy.
- IPv6. If the proxy handles only IPv4, requests over IPv6 may skip it entirely.
- Split configuration. A PAC file or a NO_PROXY list can send some names directly. That may be intentional, but it should be a decision, not an accident.
Quick tests you can run
You can test in about ten minutes with a few approaches. Use more than one, because each has blind spots.
1. Compare lookups. Resolve a name using your normal resolver, then ask for the same name in the way your client would through the proxy. If the addresses differ for a service that varies by region, the lookups are following different routes. Command-line tools such as nslookup and dig show which resolver answered.
2. Use a DNS test page. Several public pages show which resolver answered a query made from your browser. Open one with the proxy enabled. If the resolver shown belongs to your own provider or network instead of the proxy side, the browser lookups are not following the proxy.
3. Look at the traffic. A packet capture tool can show DNS traffic on port 53, or on port 853 or 443 for encrypted DNS, leaving your machine while you make a request. Start the capture, make one request through the proxy, then stop and read. Queries going toward your normal resolver mean a leak. Use this only on a machine and network you are allowed to inspect.
4. Test with curl. Make the same request twice with verbose output, once using local resolution and once using proxy resolution, and watch whether the log shows a local lookup. The guide on testing a proxy with curl shows how to read the output.
5. Test IPv6. Visit an address-echo page with and without IPv6. If the page shows an IPv6 address that does not belong to the proxy, requests are bypassing it.
A worked example
A developer sets up a SOCKS5 proxy in a command-line tool to check how her own website responds from another region. The page loads, and an address-echo page shows the proxy exit address, so she assumes everything is fine.
She then runs a lookup of her site with dig and sees the answer from her office resolver. A DNS test page, opened through the browser with the proxy enabled, also lists the office resolver. A short packet capture shows port 53 queries leaving her laptop during a request. All three agree: the web request is proxied and the lookups are not.
She changes the scheme from socks5 to socks5h in the tool, repeats the capture, and no longer sees port 53 queries during the request. In the browser she turns on the option to proxy DNS when using SOCKS v5 and disables the separate secure DNS setting that pointed to another provider. The DNS test page now shows a resolver on the proxy side. She writes the settings and the three tests in a short note, so the next person can repeat them.
Fixing a leak
Choose the fix that matches the cause.
- Make the client resolve through the proxy. Use the setting or scheme that sends hostnames to the proxy, such as socks5h in curl or the proxy DNS option in a browser.
- Prefer an HTTP proxy when the tool supports it. The hostname goes to the proxy in the request, so the request itself does not resolve locally. Other sources of leaks may remain.
- Disable competing features. Turn off prefetching, review secure DNS settings and remove extensions that make their own lookups.
- Handle IPv6. If the proxy handles only IPv4, disable IPv6 for the application or the interface in a way your policy allows, or confirm that the proxy supports it.
- Control the operating system resolver. Where policy allows, configure the system resolver explicitly so that it matches what you intend, and flush the local cache before retesting.
- Review the exceptions list. Check the PAC file and NO_PROXY for names that bypass the proxy.
- Retest after every change. Fix one cause at a time and repeat the same tests.
Credentials also matter for these tools. A proxy URL with a password in a shell history or a log is its own kind of leak, which is covered in how to store proxy credentials securely, and authentication problems can look like a leak when a tool silently falls back to a direct connection. If a tool seems to ignore the proxy only after an authentication failure, review proxy authentication in enterprise tools.
A repeatable retest routine
After each fix, run the same short routine so that results stay comparable. First flush the local DNS cache and close the browser completely. Then pick a hostname you have not visited recently. Start the capture, make one request through the proxy, and note which resolver answered on the test page. Finally write the date, the client version and the setting you changed in one line. When a later update brings the leak back, that log shows you which change to suspect first and saves a long search through every setting.
Share the log with whoever maintains the network, so a policy change such as a new secure DNS default on managed laptops does not surprise anyone later.
Reading the results
Interpreting the output correctly matters as much as running the tests. A few patterns come up repeatedly.
If the resolver shown on a test page belongs to your internet provider or your office, the lookups are going out locally. If it belongs to a public resolver you never configured, look for a browser or operating system setting that selects secure DNS, because that setting can override the normal resolver and still bypass the proxy. If the resolver appears to be on the proxy side, the lookups follow the proxy, which is the result you want in most cases.
A single test page may show several resolvers. That is not automatically a problem, since large resolver services often use many servers. What matters is whether any of them belongs to the network you wanted to keep out of the picture.
Cached answers can mislead you. If you resolved a name earlier, the system may answer from its cache without sending any query, and a packet capture will look clean even though a leak could occur later. Flush the cache, use a name you have not visited recently, or use a unique subdomain on a domain you control, and repeat.
Keep a simple record in a table so that results are comparable over time.
| Test | Expected result with proxy resolution | Result today |
|---|---|---|
| Resolver on a test page | Resolver on the proxy side | Fill in |
| Port 53 capture during a request | No queries to the local resolver | Fill in |
| curl with proxy resolution | No local lookup in the log | Fill in |
| IPv6 address echo | Proxy address or none | Fill in |
Limits and what to watch for
Passing these tests today does not prove that nothing leaks tomorrow. Updates, new extensions, VPN clients and network changes can all alter the path. Repeat the tests after any change to the device, the browser or the proxy settings.
Keep in mind:
- Test pages are third-party services. Do not send anything sensitive to them and do not treat their output as a certificate.
- DNS is only one source of leaks. WebRTC in browsers, direct connections from helper processes and application-level identifiers can reveal information that DNS tests cannot.
- A proxy is not a privacy tool for hiding illegal activity, and it is not a way around site rules, rate limits or robots.txt. Use it within the terms of the sites you visit and local law.
- Capture tools can show a lot of private information on a shared network. Capture only where you have permission and delete the file afterward.
- What a provider supports, including how its proxies resolve names, differs by plan. Check the plan page and test rather than assume.
Summary
A DNS leak happens when lookups take a different route from the proxied request. Compare lookups, use a DNS test page, watch port 53 traffic, repeat the curl test and check IPv6. Fix the cause by making the client resolve through the proxy, disabling competing features and reviewing exceptions, then retest after every change. To see which protocols a proxy service supports, visit the proxy service page.
Frequently asked questions
What is a DNS leak in a proxy setup?
It is when your device sends DNS queries to its normal resolver instead of through the proxy, even though the web traffic itself goes through the proxy. The website sees the proxy address, but your local network and resolver still see which names you looked up.
How can I test for a DNS leak?
Use a DNS test page that shows which resolver answered, or watch DNS traffic on port 53 with a packet tool while you make a request through the proxy. If queries leave your machine toward your normal resolver, there is a leak. Repeat the test after each change.
Does an HTTP proxy leak DNS?
Usually not for the proxied request, because the client sends the hostname to the proxy and the proxy resolves it. Leaks come from other sources such as a browser prefetch, a separate application or a SOCKS client that resolves names locally.
Is a DNS leak always a serious problem?
It depends on your goal. If you only need a different exit address for testing your own site, it may not matter. If you need the local network not to see the names you look up, or you need results that match the proxy location, you should fix it.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need a proxy for this?
XPASS Proxy sells residential proxy traffic by the gigabyte, with the price shown before you pay.
See proxy plansKeep reading

Proxy Guides
SOCKS5 Proxy vs HTTP Proxy: How Usage Differs in Practice
SOCKS5 and HTTP proxies both relay traffic, but they behave differently. Learn how each works, where DNS is resolved and which type suits which tool.
10 min read

Proxy Guides
How to Store Proxy Credentials Securely
Proxy credentials leak through code repositories, shell history, logs and chat messages. Learn practical storage options, rotation habits and what to do after an exposure.
10 min read

Proxy Guides
How to Configure Proxy Authentication in Enterprise Tools
A practical guide to proxy authentication: username and password, IP allowlisting, the 407 response, and how to configure common enterprise tools correctly.
10 min read