Curl: Cannot resolve socks5 hostname with socks5 protocol scheme

Created on 21 Nov 2020  路  3Comments  路  Source: curl/curl

I did this

$ curl -x socks5://127.0.0.1:9050 http://b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion
curl: (97) Could not resolve host: b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion
$ curl --socks5-hostname 127.0.0.1:9050 http://b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion
curl: (97) Could not resolve host: b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion

How it works

curl --socks5-hostname 127.0.0.1:9050 http://b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion

I expected the following

The page is downloaded successfully through tor.

curl/libcurl version

0d16a49c16a868524a3e51d390b5ea106ce9b51c

operating system

OpenBSD-current with tor 0.4.3.6

connecting & proxies name lookup

Most helpful comment

On Sat, Nov 21, 2020 at 08:44:21AM -0800, Emil Engler wrote:

$ curl --socks5-hostname 127.0.0.1:9050 http://b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion
curl: (97) Could not resolve host: b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion

I would have expected this one to work, though.

All 3 comments

Turns out this isn't a bug, just na invalid use of curl. I should have used "socks5h://"

On Sat, Nov 21, 2020 at 08:44:21AM -0800, Emil Engler wrote:

$ curl --socks5-hostname 127.0.0.1:9050 http://b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion
curl: (97) Could not resolve host: b64ig4oeqfjxnr5zt7bbqnmlccrhjsn63antgtitdubfxcvahpwvbjid.onion

I would have expected this one to work, though.

I would have expected this one to work, though.

Probably an issue with Tor. I used exactly that command line and tried from master with all resolver backends (synch, threaded, ares) to a local ssocksd instance which was passed the remote resolve every time. I also tried adding doh url (maybe in his curlrc) to see if that was it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaul picture gaul  路  6Comments

SoniEx2 picture SoniEx2  路  4Comments

xquery picture xquery  路  5Comments

ecnepsnai picture ecnepsnai  路  4Comments

stephentoub picture stephentoub  路  6Comments