Skip to content ? Ubuntu / Debian ? What is it used for?

If you’re curious about why Ubuntu and Debian have an entry in /etc/hosts mapping to your server name. You’re not alone, in fact this is not a bug nor it has been put in there by mistake.
Looking at the example below we can see the entries of my testbox:    linuxlnx    # Added by NetworkManager    localhost.localdomain    localhost
::1    linuxlnx    localhost6.localdomain6    localhost6 linuxlnx

The reason why you find the in your /etc/hosts is that some applications like GNOME expects that the hostname to be resolved to an ip address with a canonical fully qualified domain name – FQDN. As you can see on Debian documentation:

Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address localhost linuxlnx

To see whether your system hostname can be resolved to an IP address with a fully qualified domain name, use the hostname –fqdn command.

Also it could be any ip address in the address block since according to the RFC 1700 , addresses are reserved for loopback purposes.

Leonardo (using Ubuntu 10.10 Maverick Meerkat )

useful words: why debian

Posted in Knowledge Base.

Tagged with , , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.