[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/hosts ignored



> In the last few days I've been changing some configurations on my
> computer. I've been using some initrd scripts to preconfigure my system
> for two different environments successfully for quite some time. When I
> added the third one, the problems started. It might be, that I simply
> made a mistake when copying files and I cannot find it now or that
> trying to install nis was responsible. The problem must be commonplace.
> Now when I issue "dnsdomainname -v", I get this:
> gethostname()=`sonet'
> Resolving `sonet' ...
> dnsdomainname: Unknown host
> I also cannot ping sonet or hladilnik (see below for details). 
>
> Here is the relevant information:
> [/etc/hosts]
> 127.0.0.1   	localhost   sonet.utopija.linux         sonet
> 192.168.65.72   sonet.utopija.linux sonet
> 192.168.65.65   hladilnik.utopija.linux hladilnik
> 192.168.65.1    drugi_sonet drugi_sonet.utopija.linux
> 192.168.65.2    popoc	

The localhost entry should say '127.0.0.1 localhost' only. Remove the
references the rest.

Post the results of 'grep hosts /etc/nsswitch.conf'.

> [/etc/host.conf]
> order hosts,bind
> multi on

I would advise removing this file altogether. /etc/nsswitch.conf is
consulted first (if it exists) and offers greater *and clearer*
functionality.

The steps I took for my own home network configuration are available
at http://tinyurl.com/39ds9. You might find it useful to look over it.

Alexis



Reply to: