host does not resolve localhost

From: Alain (tuepla_at_telenet.be)
Date: 11/27/04


Date: 27 Nov 2004 03:03:46 -0800

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=return] files

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

netgroup: files

publickey: nisplus

automount: files
aliases: files nisplus
-------------------------
host.conf
order hosts,bind
multi on
-------------------------

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

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=1 ttl=64
time=0.084 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64
time=0.041 ms

--- localhost.localdomain ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 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=1 ttl=64 time=0.044 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.040 ms

--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 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
:(((



Relevant Pages

  • Re: DNS Errors and Ip Address Complications...
    ... using notepad or wordpad removing all the lines below "127.0.0.1 ... localhost". ... > So I should only have 1 entry yet guess what i found lol ... >> contents of the "hosts" file appears below. ...
    (microsoft.public.windowsxp.general)
  • Re: Incoming Mail Server Resetting Itself
    ... >>Each time I close Outlook Express the Incoming Mail Server ... >>gets reset to localhost. ... You'll get the Windows dialog box asking how to open the file. ... Look carefully at each hosts file. ...
    (microsoft.public.windowsxp.general)
  • Re: Localhost problem
    ... There is localhost 127.0.0.1 in it. ... It is the only symptom i can observe (and it is not only in my network but ... i didn't find any information why \\localhost doesn't work on Windows ... I have checked all my IP settings, DNS, WINS, hosts ...
    (microsoft.public.windowsxp.network_web)
  • Re: no name resolution on local domain
    ... You are correct about dig (and the other DNS query tools) ignoring ... server running on localhost even if localhost is not ... You need to have a line referring to hosts, ...
    (comp.os.linux.networking)
  • Re: Gnome Ethernet Very Slow
    ... what sholud reslov.conf & hosts have for gnome to acces the router/internet properly? ... ::1 localhost localhost.my.domain ... >>Danny Browne ... > Check your DNS settings, make sure resolv.conf points to a valid DNS ...
    (freebsd-questions)