DNS leaks and WebRTC leaks: how your real IP escapes a proxy
By the ProxyOnly team · 14 Nov 2026 · 5 min read · Updated 16 Nov 2026
A proxy hides your IP address from websites, but DNS lookups and WebRTC can still leak it. How each leak happens, how to test for them, and how to fix them.
A proxy changes the address a website sees on your requests. It does not automatically change everything else your device does. Two things in particular can reveal your real network even while a proxy is working: DNS lookups made outside the proxy, and WebRTC connections that your browser opens by itself.
This article explains both leaks, gives you a test for DNS that needs nothing but curl, covers the WebRTC settings that matter, and finishes with a short checking routine.
DNS leaks
Before a device can connect to a website it has to turn the name into an address with a DNS lookup. With a proxy, the question is who does that lookup.
If your device looks the name up locally, your own resolver, usually your internet provider's, sees every site you visit, even though the connection then goes through the proxy. The result can also point you at a different server from the one a visitor in the proxy's country would reach.
How the proxy protocol is used decides what happens:
- With an HTTP proxy, the client normally sends the hostname to the proxy. For HTTPS that is the
CONNECT host:443request. The proxy does the lookup, so the destination name is not resolved on your device. - With a SOCKS5 proxy, it depends on the client. With the
socks5://scheme the client resolves the name itself, and withsocks5h://it hands the name to the proxy. See SOCKS5 proxies explained. - Applications that ignore your proxy setting, and system services that make their own connections, are outside the proxy altogether.
A DNS test with curl
You can see who resolves a name with a hostname that cannot be resolved by anyone. The .invalid top-level domain is reserved and never resolves (RFC 2606). With no proxy, curl fails at once with an error such as Could not resolve host. With a proxy, the error tells you who tried:
curl -sS -x http://USER:PASS@HOST:PORT http://does-not-exist.invalid/ -o /dev/null -w '%{http_code}\n'Here curl does not look the name up. The proxy receives it and returns an error status, which in our test with a local proxy was a 502. If instead you see Could not resolve host in curl's own output, the lookup happened on your device. For SOCKS5, compare the two schemes:
curl -sS -x socks5://HOST:PORT http://does-not-exist.invalid/
curl: (97) Could not resolve host: does-not-exist.invalid
curl -sS -x socks5h://HOST:PORT http://does-not-exist.invalid/
curl: (97) Can't complete SOCKS5 connection to does-not-exist.invalid. (4)We ran this against a small SOCKS5 server we wrote for the test. With socks5://, curl failed locally and the server never saw the name. With socks5h://, the server received the domain name and reported that it could not reach it. The exact error code depends on your curl version, and the message text is what to read.
To fix it, use socks5h:// or the equivalent setting, such as the option to proxy DNS in Firefox, and test again.
WebRTC leaks
WebRTC is the browser technology behind video calls and similar features, and it connects devices directly where it can. To work out how, the browser collects candidate network paths, including your public address, which it learns by asking a STUN server. STUN runs over UDP, and a normal HTTP proxy cannot carry UDP. So a page can run a few lines of JavaScript and read your real public address even though every web request goes through the proxy.
Modern browsers hide your local network addresses behind random names unless you give a page camera or microphone access. The public address learned from STUN is the part that can leak.
It matters when you open pages that run WebRTC code, which includes calling features and some anti-fraud scripts, and it matters for scrapers that use real browsers, because a site that sees an address in Germany from your requests and an address in another country from WebRTC has learned something. Why websites block IPs and proxies covers why that mismatch is a signal.
Closing the WebRTC leak
In Chrome and other Chromium browsers, the setting is the WebRTC IP handling policy, which has four values: default, default_public_and_private_interfaces, default_public_interface_only and disable_non_proxied_udp. The last one stops WebRTC using UDP except through a proxy that supports it, and otherwise falls back to TCP through the proxy or fails to connect. That is the right choice for hiding your address, and it can stop calls from working.
Extensions can set the policy for you. In automation, Chromium also accepts a launch switch that forces the policy. This Playwright example sets a proxy with credentials and the switch:
import { chromium } from "playwright";
const browser = await chromium.launch({
proxy: { server: "http://HOST:PORT", username: "USERNAME", password: "PASSWORD" },
args: ["--force-webrtc-ip-handling-policy=disable_non_proxied_udp"],
});
const page = await browser.newPage();
await page.goto("https://browserleaks.com/webrtc");
await page.screenshot({ path: "webrtc-check.png", fullPage: true });
await browser.close();The switch name and behaviour can differ between browser versions and between headless and normal mode, so do not assume it works. Check with a leak test page afterwards, as this example does.
In Firefox, setting media.peerconnection.enabled to false in about:config turns WebRTC off completely, which stops the leak and also stops anything that needs WebRTC. Other settings are more selective.
A leak-checking routine
- Run the curl DNS test above with your proxy settings, and fix any local lookup.
- Open a WebRTC test page such as BrowserLeaks through the proxy and look at the addresses it lists.
- Compare them with the proxy's address, using the IP lookup tool through the proxy.
- Check that the country, time zone and language all agree.
- Repeat after any browser update, because defaults change.
If you only use plain HTTP clients such as curl or Python requests, there is no WebRTC, and DNS is the only leak to check. For a general checklist before you rely on a proxy, see how to test a proxy before you use it. The rest of what a site can learn about you is covered in browser fingerprinting explained.
Questions people ask
Does an HTTP proxy cause DNS leaks?
Usually not for the destination name, because the client sends the name to the proxy. Leaks come from clients that resolve names themselves, from applications that ignore the proxy and from system services. Test with the curl check above rather than assuming.
Does turning off WebRTC break websites?
Only features that use it, such as browser-based video calls. Ordinary browsing does not need it.
Try it yourself
Create an account, add funds from US$1 and order a proxy in the country you need.
Keep reading
16 Nov 2026 · IP addresses and privacy
Proxies, privacy and the law: a responsible-use guide
Whether using a proxy is legal, what computer misuse and data protection law say, what your provider can see about you, and a checklist for using proxies responsibly.
16 Nov 2026 · IP addresses and privacy
How to change or hide your IP address: the options compared
Seven ways to change or hide your IP address compared by what each one hides, from whom, and what it leaves exposed, with a way to check that it worked.