DNS leak
A DNS leak is when your ISP learns the names of the sites you visit, even though the requests go through a proxy.
Updated · Prokso editorial team
Before opening a site, a device asks a DNS server which IP address matches the name. By default this is your ISP's server.
If such a request goes past the proxy, your ISP sees which sites you open. And from the DNS server a site can tell that you are actually in a different country from the one the address shows.
To prevent this, the site name must be resolved on the proxy side. With an HTTP proxy this happens by itself; with SOCKS5 it depends on how the program is set up.
In browsers and antidetect browsers this setting is usually on. In your own code for SOCKS5, choose the option where the name is passed to the proxy.
socks5 or socks5h: one letter that matters
In many programs the scheme of the proxy address decides where the site name is resolved. With socks5:// the program first asks your local DNS and hands the proxy a ready IP. With socks5h:// it passes the name, and the proxy resolves it. In curl the same choice is made with --socks5-hostname instead of --socks5.
Python requests and many Node.js libraries follow this convention. If your code uses port 824 (SOCKS5) on gw.prokso.com, write socks5h in the address. With port 823 (HTTP) the name goes to the proxy anyway. Note that Python requests works with SOCKS5 only with an extra package: pip install requests[socks].
How to spot a DNS leak
Dedicated DNS leak tests make the browser look up a unique name and then show which DNS servers asked about it. If the list shows servers of your home ISP, the lookups go past the proxy. If the servers are in the proxy country, everything is fine.
There are indirect signs as well. The My IP page shows the right country, yet sites open through a distant proxy noticeably slower than they should: the request may have gone to a server picked for your real region.
Where a leak usually comes from
- The proxy is set only in the browser, while other programs on the computer resolve names on their own.
- The code uses
socks5://for SOCKS5, without the letter h. - A program supports a proxy for pages but sends DNS queries directly, ignoring the setting.
After a fix, run the test again: the result should show only servers on the proxy side.
Further reading
FAQ
Is a DNS leak dangerous?
It does not reveal page contents, but it shows which sites you open and can give away your real country.
Is there a DNS leak with an HTTP proxy?
As a rule, no: the site name is passed to the proxy, and the address is resolved on its side.
Related terms
Residential $1.59, mobile $2.50, datacenter $0.65 per GB
Sign up in a minute, get access right after payment.