Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found one tutorial on setting up sendmail that says that in the /etc/hosts file, "The entry for must always be followed by the fully qualified domain name (FQDN) of the server." Like so: localhost.localdomain localhost bigboy

(This tutorial is here).

However, I can't find anyone else suggesting something like that. instead most people seem to put some combination of localhost and localdomain.localhost after, and then some variant of the fully qualified domain name after the public ip address.

What is the correct way?

share|improve this question
up vote 1 down vote accepted

The correct way is to put the hostname after the address you want to resolve it as. This usually means the external address unless you have good reason to use the loopback address instead.

share|improve this answer
So, do you know if for the purposes of sendmail there is a good reason to use the loopback address ... as the reference I cited seems to suggest? – ben May 12 '10 at 11:26
The only reason to use it would be because the external address keeps changing since it's dynamically allocated. If this is not true then the external address should be used. – Ignacio Vazquez-Abrams May 12 '10 at 12:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.