On Sun, 26 Apr 2020 21:54:56 +0200
"Carlos E. R."
On 26/04/2020 14.52, Ruben Safir wrote:
On 4/26/20 8:02 AM, Carlos E. R. wrote:
The tools "host" or "dig" are designed to test the name servers and ignore the "files", ie, what /etc/hosts say. These tools do not replicate what happens with a normal program that asks the system for a name to IP conversion.
Instead, you test the toolchain with "ping", and then you see that /etc/hosts works perfectly.
dig souldn't ignore the resolver - which is the same library that ping would access.
Yes, it must. It has a precise purpose, documented.
I think there's some confusion about terminology. dig does not ignore the resolver: man dig: "Unless it is told to query a specific name server, dig will try each of the servers listed in /etc/resolv.conf." man resolver: "The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information. "If this file does not exist, only the name server on the local machine will be queried; the domain name is determined from the hostname and the domain search path is constructed from the domain name." man resolv.conf: "resolv.conf - resolver configuration file" So dig does use the resolver. The difference is, I think that ping typically ALSO uses /etc/hosts first, as usually instructd by /etc/nsswitch.conf So dig and ping can behave differently. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org