Dear Maintainer, My system has 2 network interfaces, one of which is connected to the internet, and the other is connected to an internal network. My application is using libcurl to send HTTP and HTTPS requests to various servers. I wish to be able to use hostnames on both interfaces, and the respective DNS servers to resolve those names. The curl documentation provides the options CURLOPT_DNS_INTERFACE, CURLOPT_DNS_SERVERS for just this purpose. However, those options require libcurl to be compiled with the c-ares backend. Refer to: https://curl.haxx.se/libcurl/c/CURLOPT_DNS_INTERFACE.html https://curl.haxx.se/dev/readme-ares.html Currently I am having to use IP addresses for the internal network. It seems like the only short term solution to use hostnames for both networks is to use a custom-compiled libcurl. In the future, can the official libcurl package be compiled with c-ares support?
Control: tags -1 patch internet, and the other is connected to an internal network. various servers. respective DNS servers to resolve those names. The curl documentation provides the options CURLOPT_DNS_INTERFACE, CURLOPT_DNS_SERVERS for just this purpose. backend. networks is to use a custom-compiled libcurl. ares support? Dear maintainer, I have opened a PR on Salsa for this: https://salsa.debian.org/debian/curl/merge_requests/5
This is not really feasible at this point, because last time I checked c-ares doesn't support glibc's NSS module system, which means this is likely to break people's systems when NSS modules are used. A long time ago there was also a problem related to IPv6 [0] which caused c-ares to be disabled in curl (see #605558). Don't know if that's fixed now (but in any case the NSS problem is a blocker on its own IMO). Cheers [0] https://curl.haxx.se/mail/lib-2009-08/0014.html
A quick search doesn't show any news about that, so I assume nothing changed. This seems to still be an issue, at least with the Stretch version. With ipv6 disabled on the interface, with and without c-ares respectively: $ LD_LIBRARY_PATH=curl-7.62.0/debian/tmp/usr/lib/x86_64-linux-gnu/ curl-7.62.0/debian/tmp/usr/bin/curl -v ftp.funet.fi * Trying 2001:708:10:9::20:2... * TCP_NODELAY set * Immediate connect fail for 2001:708:10:9::20:2: Network is unreachable * Trying 193.166.3.2... * TCP_NODELAY set * Connected to ftp.funet.fi (193.166.3.2) port 21 (#0) < 220---------- Welcome to Pure-FTPd ---------- $ curl -v ftp.funet.fi * Rebuilt URL to: ftp.funet.fi/ * Trying 193.166.3.2... * TCP_NODELAY set * Connected to ftp.funet.fi (193.166.3.2) port 21 (#0) < 220---------- Welcome to Pure-FTPd ---------- So I'll close the PR. Thanks for the insights!