Re: /etc/hosts - hostname alias for 127.0.0.1

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



On Mon, Mar 7, 2011 at 11:34 AM, Sean Carolan <scarolan@xxxxxxxxx> wrote:
> Can anyone point out reasons why it might be a bad idea to put this
> sort of line in your /etc/hosts file, eg, pointing the FQDN at the
> loopback address?
>
> 127.0.0.1    hostname.domain.com hostname   localhost localhost.localdomain
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>

It's common to do so, so that the network lookups for "hostname" still
operate, even if the rest of the network is dead. This is particularly
important for self-monitoring, sendmail (which relies on the FQHN
beinf first, mind you!!!) and X Windows.

If you have an intermittent network connection, such as one for a DSL
connected device or a roving wireless connection, keeping the hostname
in the 127.0.0.1 line helps assure that the X sessions work, even when
other connections are interrupted. It also helps improve performance
for local network access and keeps your external ports uncluttered by
local CIFS and NFS access.

That said, it can be problematic when you "ping $HOSTNAME" and get a
valid 127.0.0.1 response, and haven't actually tested your external
port. It also requires thought for configuring SSH and SNMP and NFS to
allow localhost access.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux