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

I'm running a CentOS 5.4 machine and had trouble getting sendmail to work. After a bunch of researching, I found out that I needed to change my servers FQDN. /etc/hosts had the following:    localhost localhost.localdomain  
xx.xx.xx.xx  test

(the xx.xx.xx.xx is my server's real IP address, and 'test' is I believe the name of the machine)

I removed the above two lines and replaced it with:

xx.xx.xx.xx  MyDomain

sendmail now works perfectly, but because I'm inexperienced with Linux and FQDNs, I'm not sure if changing this file will cause unexpected problems somewhere else. Web and FTP access seem unaffected, but I'm curious if any Linux gurus know if I did something wrong.

Thanks in advance!

share|improve this question
up vote 3 down vote accepted

I would suggest something like:       localhost localhost.localdomain
xx.xx.xx.xx test

Also check to see what your /etc/sysconfig/network says for the hostname value. That should either be test or

Typically, you want to reboot or restart network services after making changes to the hostname or host file.

share|improve this answer
Thanks for the reply. My /etc/sysconfig/network has 'test' as the host, so that matches. Aside from restarting httpd, are there any other network services that need to be restarted? – Arms Oct 8 '11 at 1:15
You shouldn't have to restart httpd at all. When he (she?) says "network services" he means the network stack. On CentOS I believe that would be "service networking restart" (but it might be "service network restart") – JDS Oct 8 '11 at 1:19
/sbin/service network restart – ewwhite Oct 8 '11 at 1:23

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.