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

What is the correct way?


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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy