I did this
I have in my /etc/nsswitch.conf on the host line:
I expected the following
Immediate response, as the resolver should take the IP address from the /etc/hosts file and create no dns query.
Instead, I see that the above command (I used "tcpdump -i any port 53 -n -vvv" in another console) does result in a dns query:
To exclude the resolver itself, I used the code: https://gist.github.com/mopemope/992777
Why is curl, using the same resolver, sending out a dns query when it should first look at /etc/hosts?
[curl -V output]
CentOS Linux release 7.9.2009 (Core)
The text was updated successfully, but these errors were encountered:
ares_getaddrinfo() is the getaddrinfo() cloned provided by c-ares, introduced in version 1.16.0. With older c-ares versions, curl invokes ares_gethostbyname() twice - once for IPv4 and once for IPv6 to resolve both addresses, and then combines the returned results. Reported-by: jjandesmet Fixes #7364