Re: starting X hangs on network timeout (hosts file ignored)
On Mon, Jul 12, 2004 at 12:06:41AM +0100, Steven Satelle wrote:
> > Ping uses the hosts file but host seems to ignore it. So if the
> > nameserver is not reachable then ping <hostname> works but
> > host <hostname> returns
> > 192.168.0.1 connect: Network is unreachable
> > Nameserver not reachable
> > litshi.luna.local A record not found, try again
> > my /etc/hosts has the following lines:
> > 127.0.0.1 localhost
> > 127.0.0.1 litshi.luna.local litshi
> > (I know pointing <hostname> to 127.0.0.1 is not advised, but its a
> > laptop and has several possible IPs).
> >
> > Any ideas?
> >
>
> right you are getting me puzzled now :-)
> I suppose a bit of fishing is in order
> what's in /etc/host.conf, it should say
> 'order hosts,bind'
order hosts,bind
multi on
> that file tells the sys how to resolve hosts in the network, you want it
> to check the local hosts file before going to bind
> also whats in /etc/hostname? It should, at least on my sys, have the
litshi
> hostname of the sys, not the fqdn, just the hostid.If It doesnt use
> 'hostname litshi' to set it, ignore the fqdn for now, just try with that.
> If that doesnt work, have you looked at m$ windows recently ;-)
> If even that doesnt work you could try (dont tell anyone I said this) a
> reboot, after setting the hostname and entering it into /etc/hosts, the
> files may just need to be re-read
hostname returns
litshi
now I tried pulling the cable and testing again:
ping litshi
PING litshi.luna.local (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.112 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.082 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.082 ms
host litshi
Nameserver not responding
litshi.luna.local A record not found, try again
(after reconnecting cable)
host litshi
litshi.luna.local A 192.168.0.3
/etc/hosts file:
cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 litshi.luna.local litshi
Tried everything as root and checked read permissions for all the files
ll /etc/ | grep -v ".r..r..r"
total 1620
-rw------- 1 root root 144 2002-01-18 10:13 at.deny
-rw------- 1 root root 549 2004-04-27 04:07 group-
-rw-r----- 1 root shadow 467 2004-05-08 16:54 gshadow
-rw------- 1 root root 457 2004-04-27 04:07 gshadow-
-rw------- 1 root root 998 2004-05-08 16:55 passwd-
-rw-r----- 1 root shadow 745 2004-05-08 16:55 shadow
-rw------- 1 root root 685 2004-04-01 15:52 shadow-
-r--r----- 1 root root 302 2004-04-01 06:14 sudoers
Anything else that could cause the problem?
BTW I got the following reply after I tried reporting a bug on netbase
on this:
[...] this is how it's supposed to work. host(1) is an
interface to the resolver library, which does not use /etc/hosts by design.
The problem is that it seems that a few other things seem to be
ignoring the /etc/hosts file also.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.
>
Reply to: