localhost or LAN addresses in /etc/hosts

Chris G cl at isbd.net
Fri Dec 12 18:16:38 UTC 2008

How does one decide whether to put a machine's name as a localhost
address or an actual LAN address in /etc/hosts?

My ubuntu server machine's name is isbd, this appears in three places
in /etc/hosts at the moment:-   isbd    localhost.localdomain   localhost isbd home.isbd.net isbd 84-45-228-40.no-dns-yet.enta.net chris.isbd.net

This is all very well until one runs something like dnsmasq and get
localhost addresses when asking for the address of isbd.

I think the is redundant and should be removed, can I also
remove the isbd from the line as well?  Why does it get put
there, maybe it's there for use when the machine gets its IP via DHCP
and thus it isn't fixed.

Chris Green

More information about the ubuntu-users mailing list