Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

What is correct file for /etc/hosts when running postfix mail server

my /etc/hosts      localhost        ubuntu-server

my /etc/hostname is

how must /etc/hosts look like that mail server will work correctly

now I changed to, is this correct?       localhost.localdomain                   localhost                 mail
share|improve this question
up vote 1 down vote accepted

This looks fine. You can have more than one alias on the same line though, if you want to keep the name ubuntu-server as well:       localhost mail ubuntu-server
share|improve this answer

It's not clear what you mean but there is no rule how the hosts file must look for a postfix to work properly.

Instead you need an MX entry in your DNS server for the domain if you would like to start receiving email from this domain.

share|improve this answer
I have MX record, I just want to know if is /etc/hosts file correct. I am reading that is important for server how is /etc/hosts configuried – senzacionale Jul 15 '12 at 10:40

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.