[NTLUG:Discuss] 'host' and /etc/hosts

Kelledin kelledin+NTLUG at skarpsey.dyndns.org
Thu Oct 2 11:15:53 CDT 2003


On Thursday 02 October 2003 10:59 am, brad angelcyk wrote:
> Hi all.  I am adding an entry to /etc/hosts, and when
> I use the 'host' or 'nslookup' commands, the hostname
> returns "Host <hostname> not found: 3(NXDOMAIN)".
> Although, when I ping the hostname or telnet to it, it
> does look up the IP correctly.  Is this standard?

Pretty much, yes.  The host, dig, and nslookup commands are part 
of the bind software package and interact strictly with DNS 
servers (and ONLY DNS servers) via the bind API.

Most other stuff uses glibc for hostname lookups.  glibc in turn 
uses NSS modules, which are usually configured to look up 
hostnames first via /etc/hosts, and then via DNS.  Kind of an 
annoying inconsistency, I know...

-- 
Kelledin
"If a server crashes in a server farm and no one pings it, does 
it still cost four figures to fix?"




More information about the Discuss mailing list