2

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:

127.0.0.1    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.com  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!

1 Answer 1

3

I would suggest something like:

127.0.0.1       localhost localhost.localdomain
xx.xx.xx.xx     test.mydomain.com test mydomain.com

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

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

3
  • 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, 2011 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, 2011 at 1:19
  • 2
    /sbin/service network restart
    – ewwhite
    Oct 8, 2011 at 1:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .