All locations active · 99.99% uptime
SOCKS5

Where Is DNS Resolved with SOCKS5?

This is the quietest mistake a proxy user makes: the IP address has changed, the traffic goes through the proxy — but the information about which site you are visiting leaks out of your local network. The reason is where DNS resolution is performed.

SOCKS5 offers a clear choice here, and that choice comes down to a single letter: socks5 online? socks5h ?

Two Different Paths

FIGUREThe name resolution path in socks5 and socks5h
FLOW1socks5 — local resolutionThe client queries DNS firstThe query goes to the local resolver, leavinga record2The IP is given to the proxyATYP = 0x01 (IPv4)3socks5h — remote resolutionThe domain name is given to the proxy (ATYP = 0x03)The difference is a single byte: the ATYP value

socks5 in your configuration means the client resolves the domain name itself and hands the proxy a ready IP. That means every site you visit ends up in the local DNS records.

How Does the Leak Happen?

When resolution is done locally, the DNS query goes to one of these places:

  • To your internet service provider's resolver — which sites you visit is recorded.
  • To the corporate network's DNS server — the network administrator sees your traffic.
  • To a public resolver — the query is made from your real IP.

In all three cases, part of the privacy the proxy provides is wasted. For more on the types of leaks see our is a proxy safe article, and for testing our DNS leak test tool.

The Correct Configuration

FIGUREForcing remote resolution
Correct and incorrect usage01# WRONG — DNS is resolved locally, which causes a leak02curl --socks5 proxy.example.com:1080 https://example.com03export ALL_PROXY="socks5://proxy.example.com:1080"0405# CORRECT — DNS is resolved on the proxy side06curl --socks5-hostname proxy.example.com:1080 https://example.com07export ALL_PROXY="socks5h://proxy.example.com:1080"0809# Python requests10proxies = {"https": "socks5h://kullanici:sifre@proxy.example.com:1080"} # correct11# proxies = {"https": "socks5://..."} # leaks1213# Node.js — socks-proxy-agent14new SocksProxyAgent("socks5h://proxy.example.com:1080") // correct

The h letter in the scheme stands for "hostname". This one-letter difference is the line between a leak and privacy.

Critical

The defaults are not safe. In many libraries, writing socks5:// performs local resolution. When writing your configuration, deliberately choose socks5h .

The Situation in Browsers

Browsers may resolve DNS locally by default when using SOCKS5. Firefox has an explicit setting that changes this:

BrowserSettingResult
Firefoxnetwork.proxy.socks_remote_dns → trueDNS is resolved on the proxy side
ChromeUses the system proxy settingBehavior depends on the platform
Chrome (flag)--proxy-server="socks5://..."Generally performs remote resolution

You can reach the Firefox setting via about:config . For browser-specific details, see Firefox proxy settings article for details.

What About HTTP Proxies?

With an HTTP proxy this problem generally does not exist: because the full URL or the CONNECT target is sent as a domain name in the request line, the proxy performs the resolution. This means that, in terms of DNS, an HTTP proxy is safer by default.

FIGUREDNS resolution behavior
COMPARISONHTTP proxySOCKS5Default resolutionOn the proxy sideOn the client sideLeak riskLowDepends on the configurationCheckAutomaticAn explicit choice with socks5hDomain name privacyPreservedProtected with socks5h

SOCKS5 is more flexible but requires more care. That flexibility brings a responsibility: choosing the right scheme is up to you.

Verification

Test that your configuration really performs remote resolution:

FIGURESteps for verifying a DNS leak
TESTRun a DNS leak testIs the resolver shown in the proxy's country?Check the exit IPIs the proxy really active?Confirm that you wrote socks5hCheck the configuration by eyeCheck the browser settingFirefox: socks_remote_dnsClear the system DNS cacheOld records can mislead youRepeat the test on different networksA corporate network may behave differently

You can run the leak test from our DNS leak test page , and check your exit IP with My IP Address .

Summary

In SOCKS5, where DNS resolution is performed is the client's choice, and the default is usually unsafe. Using the socks5h scheme prevents domain name information from leaking out of your local network. In this respect an HTTP proxy is safer by default. After writing your configuration, always verify it with a leak test — a single missing letter can largely defeat the purpose of using a proxy.

Frequently Asked Questions

01What is the difference between socks5 and socks5h?

socks5h sends the domain name to the proxy and lets it do the resolution. socks5 resolves the domain name locally and hands the proxy a ready IP; in that case the DNS query leaves your local network.

02Why do DNS leaks matter?

Even if your IP address is hidden, which sites you visit is recorded by the local resolver. This removes a significant part of the privacy a proxy provides.

03How do I stop DNS leaks in Firefox?

Go to about:config and set network.proxy.socks_remote_dns to true. This setting makes DNS resolution happen on the proxy side when a SOCKS proxy is used.

04Doesn't this problem go away if I use an HTTP proxy?

With an HTTP proxy the resolution is usually done by the proxy, so the default behavior is safer. Even so, verifying it with a leak test is a good habit.

05How do I test whether there is a leak?

Run a DNS leak test tool and look at the location of the resolvers it shows. If resolvers in your own country appear while the proxy is in another country, there is a leak.

Related Articles and Pages

NEXT STEP

Strengthen your proxy setup today.

Get started in minutes with a paid plan, or try our free proxy list first.

FREEPROXY.TR

Looking for a free proxy? You're in the right place

A complete proxy platform where you can browse up-to-date free proxy addresses, compare HTTP and SOCKS proxy types, and check your proxy connections with free tools.