nslookup not using /etc/hosts

Stefan Bruda yellowdog-general@lists.terrasoftsolutions.com
Mon Sep 29 10:54:01 2003


Hi.

At 16:59 +0100 on 2003-9-29 Farrelly, Stefan wrote:
 >
 > Ive just installed Yellowdog Linux v3.0 on my G4 and I cant get
 > nslookup (or host or dig) to check the /etc/hosts file for entries
 > I have there, despite /etc/nsswitch.conf having hosts set to files
 > then dns

In fact, those you mention are DNS tools, they are designed to ignore
/etc/hosts no matter the content of nsswitch.conf.  Other applications
are aware of the existence of /etc/hosts so you should be good to go.

If you want to check the content of /etc/hosts you can use traceroute
which also does a reverse name lookup (which include /etc/hosts as
directed by nsswitch.conf).  So if you have an entry called `w' in
your hosts file, do a `traceroute w' to check it (and watch between
others the first line emitted by the program).

Stefan

-- 
If it was so, it might be; and if it were so, it would be; but as
it isn't, it ain't. That's logic.
    --Lewis Carroll, Through the Looking-Glass