Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

127.0.0.1 bigboy.my-site.com 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 127.0.0.1, and then some variant of the fully qualified domain name after the public ip address.

What is the correct way?

share|improve this question

1 Answer 1

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

 
discard

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