cURL / Mailing Lists / curl-library / Single Mail


Re: best practices: c-ares vs threaded resolver

From: Ben Greear <>
Date: Tue, 17 Sep 2013 09:59:59 -0700

On 09/17/2013 09:46 AM, Gisle Vanem wrote:
> "m brandenberg" <> wrote:
>> So these and other issues make me want to use the system resolver
>> library. When it fails, there's a general system/network
>> configuration issue that doesn't become a support issue for us.
> I tend to agree. The systems resolver seems alway to work best
> for me. At least when I use a VPN. Then (without messing with my routing-
> table, C-ares is using the default interface which doesn't work). I whish
> there could be a config-file similar to '/etc/resolv.conf' for C-ares/Win.
> Besides the new C-ares functions for specifying DNS addr/iface that's
> recently been added to curl does nothing on Windows; '--dns-interface'
> boils down to 'setsockopt (..SO_BINDTODEVICE)' and '--dns-ipvX-addr'
> boils down to a 'bind(..ipvX-addr)' which AFAICS is useful only for those running a DNS-server locally. I doesn't do any good on my Winsock. The
> '--dns-ipvX-addr' option should IMHO be used to specify what DNS-server
> to connect to.

Even on Linux, you might have to play some routing-table tricks to make the bind(local-ip) work
as expected, but at least it can be done.

I have no idea how to make this sort of thing function fully proper on Windows, though
I would expect binding to a local IP might be useful on a multi-homed machine.

I know BSD doesn't have SO_BINDTODEVICE, but I do not know the exact behaviour
of binding to local IP.


> --gv
> -------------------------------------------------------------------
> List admin:
> Etiquette:

Ben Greear <>
Candela Technologies Inc
List admin:
Received on 2013-09-17