I have tried using curl through tor like so

 curl --socks5 XXXXXXXXXXXXXXX.onion

This works for public addresses like stackoverflow.com but not for tor .onion addresses

2 Answers 2


You should use --socks5-hostname instead of just --socks5.

This way, the socks5 proxy does the hostname resolution. Otherwise curl tries to resolve the hostname itself, which it can't.


Moreover, you should use torsocks - built-in utility for working with Tor Network.

It is designed to prevent any leakage! Please, read the man page.

For example:

root@localhost:/# torsocks curl XXXXXXXXXXXXXXX.onion

Otherwise, if you are trying to resolve .onion name to IPv6, you are able to use tor-resolve utility, it is built-in too:


root@localhost:/# tor-resolve kpvz7ki2v5agwt35.onion 

Of-course, this IP address it temporary one and can be used only from your localhost for the limited time.

Moreover, your traffic shall be redirected through Tor's transparent proxy connections port - TransPort, which is always, by default 9040. See the documentation about transparent & isolated proxies on the torproject.org's wiki site.

Thereafter, you can use this IP directly with curl:

anonymous@localhost:/$ curl fe80:7cd1:5f4e:a9d5:dfe:1976:5edf:4386

Or just use .onion domain:

anonymous@localhost:/$ curl XXXXXXXXXXXXXXX.onion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.