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 making some system hostname changes across a few environments and this got me thinking...

When I change a server's hostname (live), what needs to be modified and which system services require a restart? Assume this is done online without a reboot.

I encounter a lot of systems built by other people where hostname changes are made in-flight, but the changes either do not persist across a reboot, or I notice that /var/log/messages are stamped with a different hostname.

I regularly follow:

On the daemon side...

  • sendmail/postfix (matching hostname is required)
  • cups (print daemon may stop with bad hostname)
  • syslog/rsyslog (hostname is logged along with system messages)
  • httpd (proper hostname is required)

What else requires attention?

share|improve this question
On which distribution? – Frands Hansen Oct 6 '12 at 22:03
Red Hat derivatives. – ewwhite Oct 6 '12 at 22:06
Avidly awaiting the responses. – Magellan Oct 6 '12 at 22:10
Why do you have a hostname set in your httpd(apache) config? Other then hosting a vhost for the systems hostname, it shouldn't be required anywhere. – Zoredache Oct 7 '12 at 2:47
@Zoredache Because of "httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName" – ewwhite Oct 7 '12 at 2:53
up vote 9 down vote accepted

This depends on the distribution. From your post, it looks very much like you are using either RHEL or CentOS. That's what I'll assume in my answer.

A lot of services look at the server's hostname, so it is very hard to generally give a complete overview of which services you need to restart. However, be aware of the following:

  • Some Postfix installs have the hostname hardcoded in config as well.
  • Same goes for Apache
  • If you use NFS, you need to care for that
  • On RHEL HA clusters you need to care for the cluster configuration

Usually, I also issue hostname to set the hostname without rebooting.

Also, I grep through /etc and subdirs (config files) to find anywhere the server hostname has been set. Same goes for configuration files of custom compiled software.

Another thing to be aware of is external dependencies. In the environments I usually work with, things like Monitoring, Backup and Configuration Management are also dependant on the hostname of the server, and a lot of stuff will break if this is not taken into consideration.

share|improve this answer
+1 on the hostname command. I did not think about the config files in /etc. Any other examples? – ewwhite Oct 9 '12 at 15:22
I've been pondering about this question. I can't come to think of more things, but I will have it in mind next time I have to change one, and if I come across something that is not mentioned here, count on me updating my answer :) – Frands Hansen Oct 10 '12 at 0:41

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.