/etc/hosts file

Bill Gradwohl <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <[email protected]>
For arcane security reasons, I'm not permitted to start a name server on a particular box. Therefore I'm trying to use /etc/hosts.

Given that /etc/nsswitch.conf contains a line as follows:
hosts: files dns

Adding the following to the /etc/hosts file:
192.168.1.123          box1.private.xyz              box1
allows 
ping box1 
or 
ping box1.private.xyz
to function as expected resolving to the 192.168.1.123 address.

Keying in:
host box1
or
host box1.private.xyz
fails on nxdomain. Why? Anyone know how to get 'host' to use /etc/hosts? I thought all utilities using library functions follow the nsswitch.conf specification for resolution.

Also, I'm unable to put any kind of reverse address resolution into the /etc/hosts file that works.

Anyone know of a way to modify /etc/hosts to allow something like ping to reverse resolve as in:
ping 192.168.1.123 
and have it display the hostname next to the ip address?


Bill Gradwohl
[email protected]
(817) 224-9400 x211
www.ycc.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.