Home » How To.. » Linux » Incorrect Hostname Mapping

Incorrect Hostname Mapping

Problem:

Some linux distributions do not correctly map the system's hostname for proper use in a networked environment. This may occur if the distribution does not prompt for a domain in addition to the hostname, or does not allow for the configuration of a static IP address during the install process. This may then cause various connectivity problems.

Solution:

If you suspect this may be the case, check the /etc/hosts file. Therein should be at least the following entry:

127.0.0.1 localhost.localdomain localhost

If there is anything besides localhost and localhost.somedomain, remove that. There may be an additional line with the system's actual hostname and domainname, but they should be after the actual external IP address of the system, not following 127.0.0.1.

Last updated October 2007, by Nathan Gamber