cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Make DNS requests follow the CURLOPT_INTERFACE if c-ares is in use

From: Kim Vandry <vandry_at_TZoNE.ORG>
Date: Wed, 17 Jul 2013 20:48:20 -0400

On 2013-07-17 18:01 , Daniel Stenberg wrote:
>> * 350f8e7 Document CURLOPT_DNS_{INTERFACE,LOCAL_IP4,LOCAL_IP6} options
>> * 483f06c dns: Support binding DNS to local interface/IP
>
> Is there a particular reason we can't merge LOCAL_IP4 and LOCAL_IP6 into
> a LOCAL_IP and have libcurl just check which version that's used?

Quick answer: it's just a thin layer over the existing c-ares
ares_set_local_ip4() and ares_set_local_ip6(), so we are just copying
the interface (blame c-ares).

Longer answer:

First, let me say that my use case doesn't require
CURLOPT_DNS_LOCAL_IP{4|6}, I only require CURLOPT_DNS_INTERFACE. I
presume Ben needed those options. So Ben may be able to demonstrate a
more compelling use case than I.

Because we may not know until the transfer starts which DNS servers are
going to be used, or else because we are going to use a mix of IPv4 and
IPv6 DNS servers, we have to specify in advance both an IPv4 address and
an IPv6 address to bind to, if we want both protocols to use a bound
address. That being said, would you propose to use a single option
LOCAL_IP that gives them both, separated by some delimiter? I think 2
options is better.

-kv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-18