entries in hosts file not used in host lookup

Miner, Jonathan W (CSC) (US SSA) jonathan.w.miner at baesystems.com
Mon Nov 29 19:40:28 UTC 2004


The "host" command only does DNS lookups, and will not read your =
/etc/nsswitch.conf or /etc/hosts files.


-----Original Message-----
From:	bind-users-bounce at isc.org on behalf of Alain
Sent:	Sat 11/27/2004 05:16 AM
To:	comp-protocols-dns-bind at isc.org
Cc:=09
Subject:	entries in hosts file not used in host lookup
hello

I have a strange problem with the hosts file

quering for 127.0.0.1 and localhost does not use the /stc/hosts file
---------------------------
my /etc/host file:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1    localhost.localdomain localhost
---------------------------
my resolv.conf
; generated by /sbin/dhclient-script
search athome.be
nameserver 192.168.0.1
---------------------------
my nsswitch.conf

#
# /etc/nsswitch.conf
#
passwd:     files
shadow:     files
group:      files

hosts:      files dns

bootparams: nisplus [NOTFOUND=3Dreturn] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   files

publickey:  nisplus

automount:  files
aliases:    files nisplus

then:
host 127.0.0.1
Host 1.0.0.127.in-addr.arpa not found: 2(SERVFAIL)

and
Host localhost not found: 3(NXDOMAIN)

but=20

ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3D1 ttl=3D64
time=3D0.084 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3D2 ttl=3D64
time=3D0.041 ms

--- localhost.localdomain ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev =3D 0.041/0.062/0.084/0.022 ms

also
ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=3D1 ttl=3D64 time=3D0.044 ms
64 bytes from 127.0.0.1: icmp_seq=3D2 ttl=3D64 time=3D0.040 ms

--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev =3D 0.040/0.042/0.044/0.002 ms


if a put a dummy entry in hosts file eg

10.0.0.10  dummy.domain.org

hosts won't resolve it


I think the problem comes down to the fact that host does not read my
/etc/hosts file but does query the configured DNS instead wich does
not reply for such a query, but how can I setup networking this will
work.

Originally I was testing the openldap suite but tests failed due to
localhost lookup :((, and I needed openldap as a JNDI implementation
:(((

Any advice would be apriciated







More information about the bind-users mailing list