cURL / Mailing Lists / curl-library / Single Mail


Re: dns via socks5 failed?

From: Richard Atterer <>
Date: Sat, 5 Jan 2008 01:50:03 +0100

On Fri, Jan 04, 2008 at 04:09:54PM -0800, Dan Fandrich wrote:
> I see no reason to have such a distinction.

The distinction is made by the SOCKS protocol. With v4, v4a and v5 there
are three different versions, and only v5 allows both types of DNS lookup.

But that is an academic argument - I basically agree: The API should be
consistent! Either there should be an option to pass hostnames or IP
addresses, or there should be four SOCKS variants! Just avoid "SOCKS5A" as
a constant, as that is a bit confusing.

Oh, and the naming of any "DNS" option is actually misleading IMHO. At the
protocol level, the distinction is between "send IP address" and "send
hostname", DNS lookups only come in indirectly.
Tor is a good example: If I use the "send hostname" variant to access an
.onion site, then *no* DNS lookup will actually be performed at all,
neither by the client nor the server.

So my humble suggestion would be:




  plus a --socks-hostname/SOCKS_HOSTNAME option, applicable to both v4 and v5

IMHO, for compatibility reasons the meaning of CURLPROXY_SOCKS5 should not
change. By the way, the following page says that SOCKS 5 "usually uses IP
addresses in practice":



  __   _
  |_) /|  Richard Atterer     |  GnuPG key: 888354F7
  | \/|  |  08A9 7B7D 3D13 3EF2 3D25  D157 79E6 F6DC 8883 54F7
Received on 2008-01-05