FS#49962 - [curl] please add c-ares for the --dns-servers option

Attached to Project: Arch Linux
Opened by Peter Wu (Lekensteyn) - Tuesday, 05 July 2016, 20:37 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 29 March 2017, 18:53 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
For a Network Manager dispatcher script, I would like to override the DNS server for curl since resolv.conf is not yet configured. That is however not possible at the moment because curl is not built with c-ares.

Package version:
curl 7.49.1-1

Steps to reproduce:
$ curl --dns-servers 8.8.8.8 example.com
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.

Manual excerpt:
--dns-servers <ip-address,ip-address>
Set the list of DNS servers to be used instead of the system default. The list of IP addresses should be separated with commas. Port numbers may also optionally be given as :<port-number> after each IP address.

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares back‐ end is the only such one. (Added in 7.33.0)
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 29 March 2017, 18:53 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Unless there's compelling new evidence to enable c-ares, this isn't a good tradeoff.
Comment by Dave Reisner (falconindy) - Wednesday, 06 July 2016, 14:09 GMT
Last I checked, c-ares is slower than the threaded resolver and is not at feature parity with the libc resolver. I'm aware of other distros who briefly linked to c-ares, and then reverted this (redhat, fedora, debian/ubuntu).

There's also been several reliability problems with c-ares in the past:

https://curl.haxx.se/mail/lib-2009-08/0014.html (I don't know if this is still valid)
https://curl.haxx.se/mail/lib-2013-09/0098.html
https://bugs.archlinux.org/task/22797 (it seems that c-ares since has learned to read nsswitch.conf and hosts but still has shortcomings)

If the *only* advantage of using c-ares is support for --dns-servers, I don't know that this is a sensible thing to do.
Comment by Joss Wright (tealeaf) - Wednesday, 29 March 2017, 15:40 GMT
This would also be necessary for full Tor support, which requires using Tor's internal DNS server for accessing .onion domains.

I found this bug through trying to use curl through Tor, and that seems a significant-enough use case to enable this, unless it is actively harmful in normal usage.

Please consider it.
Comment by Joss Wright (tealeaf) - Wednesday, 29 March 2017, 15:45 GMT
Sorry... just to add to this. More importantly than allowing curl to access .onion domains, this is also necessary to prevent curl from leaking its DNS requests when going through Tor, and thereby harming the anonymity of the user.
Comment by Dave Reisner (falconindy) - Wednesday, 29 March 2017, 17:43 GMT
Here's a list of major distros not using c-ares:

Fedora
Ubuntu
Debian
OpenSUSE/SLES
CentOS/RHEL

Here's a list of distros using c-ares:
(i honestly don't know of any)

If you care about c-ares, then please look into the shortcomings/reliability issues I posted about nearly a year ago. Talk to maintainers in other distros and find out why they aren't using c-ares (because no one is really doing this). I'm not making sacrifices just for Tor -- it's not something I'm ever going to care about.
Comment by Joss Wright (tealeaf) - Wednesday, 29 March 2017, 18:38 GMT
It's hard to argue with 'it's not something I'm ever going to care about', but just for posterity I'll note that you posted three issues, and I've read the threads and some background for all of them:

The first is from 2009. That's eight years ago and I've seen various threads mentioning that it's now solved.
The second is from 2013 -- four years ago -- largely seems to refer to MacOS X, and notes that 'the c-ares we're using *is* old, 1.7.1'. So an old version, on MacOS X, from four years ago. The main complaint there is general and unspecific unreliabilities.
The third issue you've already noted was half-solved. I'm not sure how the NSS/mDNS support has resolved, or how much of an issue it is.

Anyway, I'm not saying this to change your mind, just to update the set of issues you listed. I'll look at making an AUR package for curl with ares compiled in.

Loading...