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:
- Run
hostname <new-short-hostname>
- Modify
/etc/hosts
according to these guidelines. - Modify
/etc/sysconfig/network
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?