unsure about /etc/hosts

Nikolas Britton freebsd at nbritton.org
Mon Nov 22 15:50:00 PST 2004

Oliver Fuchs wrote:

>I am at the moment unsure about the localhost entries in my /etc/hosts. From 
>/usr/src/etc/hosts I have found this one:
># Host Database
># This file should contain the addresses and aliases for local hosts that
># share this file.  Replace 'my.domain' below with the domainname of your
># machine.
>::1			localhost localhost.my.domain
>		localhost localhost.my.domain
>So my hostname is I.and.I so the /etc/hosts entry must be:
>::1			localhost localhost.and.I
>		localhost localhost.and.I
>Now regarding some programs (e.g. mutt) this option is not able to deliver
>mail locally instead putting it in /var/spool/mqueue or
>If I use this:
>::1			localhost I.and.I
>		localhost I.and.I
>I have no problems with sending the mail locally. So I am a little bit
>confused about what is the correct way to define the localhost in
>Thanx in advance
I'd like to know this too as I have seen meny diffrent ways too layout 
the hosts file. here what I got in mine:

::1                localhost localhost.intranet     localhost localhost.intranet
::1                spectra spectra.intranet     spectra spectra.intranet

but this same hosts file also says to do it like this:
# Imaginary network.
#               myname.my.domain myname
#               myfriend.my.domain myfriend

So which way do you list them. And say spectra.intranet (me) am I 
suppost to list it as localhost or the real ip address?

More information about the freebsd-questions mailing list