Comment 24 for bug 19775

Revision history for this message
Thomas Hood (jdthood) wrote :

goto wrote:
> Erm, why not just have:
>
> 127.0.0.1 localhost.localdomain localhost myhostname
> 10.20.21.22 myhostname
>
> like at http://www.faqs.org/docs/securing/chap9sec95.html

One reason for not doing that is that the FAQ is for RedHat, not for Ubuntu.

Another reason for not doing that is that it fails to specify unambiguously
what the IP address of "myhostname" is. If the resolver decides that
127.0.0.1 is the IP address for myhostname (because that line happens
to come first?) then a reverse lookup will yield the result that "localhost"
is the canonical hostname for "myhostname".

People should also read hosts(5).