Understanding the Difference Between DNS Resolvers
Solution 1:
I would expect curl
to us the resolver library which will use the name service providers listed in the /etc/nsswitch.conf
hosts specification in order. If this does not include DNS, DNS resolution will not occur. nslookup
is not documented to use this file, but from your experience it appears it may. Often this data is cached by a name service caching daemon. If the daemon, is failing you may get this kind of issue even if the other configurations are correct.
host
and dig
are pure DNS lookup programs. They both resolve names only via DNS. They will not resolve names using files or other non-DNS providers. I would expect them to use the information in /etc/resolv.conf
directly.