You just got a clean response from a geo check, and the page looks right for the country you asked for. The curl socks proxy line in the terminal shows no timeout and no handshake error. Then the landing page still shows the language and prices from your office, not the city on the proxy. The request left through the proxy. The name lookup did not.
That split burns an afternoon for ad verification, price monitoring, and location-dependent QA. SOCKS is a lower-level relay. It can carry HTTPS without reading the HTTP request, and it does not decide where DNS runs. The flag, the URL scheme, and whether you passed a hostname decide that.
Start with remote DNS for almost every legitimate check: account work inside platform rules, market research, brand protection, and campaign QA. Local DNS is a choice you make on purpose, not the leftover from a short flag.
SOCKS Modes, DNS Resolution and Proof
The default I would start with is SOCKS5 with remote DNS. Use --socks5-hostname or the socks5h:// scheme so the proxy's network location shapes the answers. The curl SOCKS proxy documentation describes four operational variants, SOCKS4, SOCKS4a, SOCKS5, and SOCKS5-hostname, and they differ on DNS privacy, IPv6, and geo-dependent requests. HTTP and SOCKS proxies can both take optional authentication.
| Flag or scheme | Protocol | Hostname resolved by | IPv6 support |
|---|---|---|---|
--socks4 or socks4:// |
SOCKS4 | Local, on the client | No |
--socks4a or socks4a:// |
SOCKS4a | Proxy | No |
--socks5 or socks5:// |
SOCKS5 | Local, on the client | Yes |
--socks5-hostname or socks5h:// |
SOCKS5 with remote DNS | Proxy | Yes |
One request per row, always with the port, against the same hostname:
curl --socks4 proxy.example:1080 https://example.com/
curl --socks4a proxy.example:1080 https://example.com/
curl --socks5 proxy.example:1080 https://example.com/
curl --socks5-hostname proxy.example:1080 https://example.com/
The scheme forms match those flags: curl -x socks5://proxy.example:1080 https://example.com/ and curl -x socks5h://proxy.example:1080 https://example.com/. A bare -x proxy.example:1080 is not a SOCKS proxy. With no scheme, curl treats the value as an HTTP proxy, and the job can "succeed" on the wrong protocol. That silent misread is why I write the scheme every time, including when a shell exports ALL_PROXY.
What the trace has to show
A completed page is not proof of DNS privacy. The bytes can exit through the proxy while the lookup still hits your local resolver, so the geography of DNS can contradict the geography of the exit IP. The curl proxy connection guide separates socks5:// (local name resolution) from socks5h:// (proxy-side resolution). Verbose output reports the destination as "locally resolved" or "remotely resolved."
Run the same hostname twice and read those lines:
curl -v -x socks5://proxy.example:1080 https://example.com/
curl -v -x socks5h://proxy.example:1080 https://example.com/
Use a hostname. A pre-resolved address such as 203.0.113.10 leaves the proxy nothing to resolve, so socks5h:// cannot move DNS. The same trap shows up in a proxy detection test: the exit address looks right while the name path does not.
Practical rule:
socks5hwhen the proxy's location should shape DNS answers. Plainsocks5only when the name is already resolved, or when you intend local DNS.
Before you trust a passing request, check three things. The scheme is explicit. The destination is a hostname, not an address. One verbose trace shows remote resolution. If delegation itself is failing upstream of curl, it helps to monitor DNS delegation failures as a separate health signal, rather than blaming the SOCKS handshake.
How to Run a SOCKS5 Request Step by Step
A repeatable request is a short sequence. Each line exists so the next failure has one cause.

Confirm the build supports SOCKS. Run
curl -Vand look forSOCKS5on the features line. A build without it fails with an unsupported-protocol error, and no flag change will fix a missing feature.Collect host, port, and credentials before you type the URL. SOCKS5 commonly listens on 1080, but use the port your provider assigns. Keep the password out of shared shell history. A screenshot of the terminal is enough to leak it into a ticket.
Run the baseline with the port every time.
curl --socks5-hostname proxy.example:1080 https://example.com/is the line I want in the runbook. Omitting the port is how a "works on my laptop" note becomes a refused connection on the next machine.Add authentication beside the URL, not inside it.
--proxy-user username:passwordsends credentials to the proxy and keeps the password out of the proxy string. Usesocks5h://username:password@host:portonly when a wrapper accepts nothing else, and percent-encode reserved characters if you must.Limit environment proxies to one session. For tools that read the environment, set
ALL_PROXY=socks5h://proxy.example:1080, run the job, then unset it. Child processes inherit that variable. A later monitoring job will ride the same exit if you leave it set.Judge the body, not the silence. Write the response with
-oand read the status and the content. An empty error stream is not success. A healthy run is a completed response, no timeout, and the same result on a second run against the same hostname.
If the second run flips country or language, the proxy accepted the connection and the session did not stay put. Fix session behavior before you scale the script.
IPv6, Carrier NAT and What Your Test IP Means
The failure people misread first is an IPv6 destination through SOCKS4. SOCKS4 and SOCKS4a cannot carry IPv6 destinations, so an IPv6-only target fails in those modes. SOCKS5 can carry it. Pair the same URL:
curl -4 --socks5-hostname proxy.example:1080 https://example.com/
curl -6 --socks4 proxy.example:1080 https://example.com/
A -6 failure in a SOCKS4 mode is expected behavior, not a dead proxy. Switch the mode before you open a ticket on the host.
A short glossary keeps the rest of the address story straight.
- Sticky sessions: one exit IP for a set window, so a multi-step flow stays on the same address.
- Rotation: the exit IP changes per request or per interval.
- ASN: the autonomous system number of the operator that announces the address.
- Geo-targeting: choosing an exit by country or region.
Carrier-grade NAT (CGN or CGNAT) lets an operator share public IPv4 among many subscribers. RFC 6598 reserves 100.64.0.0/10, from 100.64.0.0 through 100.127.255.255, as Shared Address Space. Many users can appear on a smaller pool of public IPv4 addresses. An observed IP is not a one-to-one identifier, and reputation or rate limits can hit several subscribers at once.
A mobile (4G/5G) exit sits on a carrier network behind that shared space, which is why sites pay a high cost if they block the address wholesale. A residential exit comes from a household connection and is easier to tie to a single line. A datacenter exit is announced from hosting space and is easier to classify by ASN. Treat IP geolocation as approximate. Pair it with timestamps, application logs, and authentication records. If the job needs a fresh mobile exit on a schedule, a rotating mobile proxy is the control for that interval, not a second DNS flag.
Health Checks and Fixes for Failed SOCKS Connections
Stop calling every failure a bad proxy. Split reachability, authentication, DNS, TCP, TLS, and the application response. The curl SOCKS5 option notes are the basis for that split, including local and proxy-side name lookup.

Cap setup with --connect-timeout 5 and the whole transaction with --max-time 30. Add -v so you can see the handshake, the lookup, TCP, and TLS as separate stages. Record numbers with -w '%{http_code} %{time_namelookup} %{time_connect} %{time_appconnect} %{time_starttransfer} %{time_total}\n'.
Run at least 30 iterations per endpoint. Success is completed application responses divided by attempts, not a TCP handshake that never returned a page. Hit more than one destination. One site can hide a DNS failure or a destination-specific policy.
| Error or exit code | Likely cause | Fix |
|---|---|---|
| curl exit 7, failed to connect | Proxy host, port or firewall blocks the SOCKS port | Confirm host and port, test the port from the same machine, check firewall rules |
| curl exit 5, could not resolve proxy | Proxy hostname is misspelled or local DNS cannot resolve it | Fix the spelling or use the proxy's IP address |
| curl exit 97, proxy handshake error | Missing or wrong credentials, or the SOCKS version does not match the flag | Check --proxy-user and match --socks5 or --socks4 to the proxy's protocol |
| curl exit 6, could not resolve host | Destination name is not resolved locally | Switch to --socks5-hostname so the proxy resolves the name |
| curl exit 28, operation timed out | Slow or overloaded proxy, or a session rotating mid-request | Raise --max-time modestly, retry with backoff, and review the rotation interval |
| curl exit 35, SSL connect error | TLS fails through the tunnel, often a wrong scheme or an intercepting device | Verify the target URL scheme and inspect the certificate chain with -v |
Fail fast on authentication and hard connection errors. Retry only transient network failures, with a bounded backoff. Never log a proxy URL that still contains the password. A refused port is a reachability problem. Walk it with the notes on a proxy refusing connections before you rotate credentials. When the path is up and the transfer is slow, the same patience you use for RedSim support for slow connections applies here. Raise the ceiling a little, then measure, instead of looping the same command.
Choose the Right SOCKS5 Setup for Your Workflow
Put the checks into one wrapper and stop improvising flags per ticket. The script sets socks5h, reads the username and password from a secrets store rather than the command line, applies the five-second connect cap and the thirty-second total cap, and logs the proxy host only. A password in a process list is a leak, even when the request is legitimate.
Match the setup to the job. Throughput alone tells you almost nothing.
QA of geo-dependent flows and ad verification should stay on SOCKS5 with remote DNS, and the verbose resolution line belongs in every run. A passing request only proves the tunnel carried traffic. It says nothing about where the hostname was resolved, so read the trace and confirm the proxy did the lookup before you trust the result. A green HTTP status with a local lookup will certify the wrong market. Save the trace next to the creative or the checkout step you were checking.
Multi-account social management and market research care more about session stability than raw speed. Sticky behavior has to survive a pilot of linked steps before you scale. Rotation belongs on independent requests, not in the middle of a login and a profile edit. Confirm that in a small batch, then widen it.
Monitoring at volume, price checks, SEO snapshots, and brand-protection fetches, needs a schedule. Health-check on an interval, cap retries, and track success rate per endpoint as completed responses over attempts. A single happy curl hides a destination that fails one time in five.
Mobile proxies are not to be bought expecting to evade detection or bypass access controls.
Dedicated mobile proxies are for controlled, legitimate tasks: account management within platform rules, ad verification, market research, SEO monitoring, brand protection, and location-dependent quality assurance. If the plan is to slip past a control the site put there on purpose, the right choice is not a different flag.
Evoproxy offers mobile 4G/LTE connectivity with country- and carrier-oriented routing, session controls, and HTTP or SOCKS5 access. If your workflow needs that mobile context with session control, review the listed settings against your compliance records and evaluate a mobile proxy configuration that matches your target network conditions before rollout.
Evoproxy gives you mobile 4G/LTE proxies you can drive with curl over SOCKS5, with country- and carrier-oriented routing and session controls, so geo checks, ad verification, and location-dependent QA see the network you meant to test. Sticky work and rotating work stay on separate jobs instead of one shared guess. Visit Evoproxy to evaluate a mobile proxy configuration that matches your target network conditions before you put it in a script.






