CentOS - Hostname change
By default, your server is started with the server’s given name as the hostname. Some software, such as cPanel, requires a valid Fully Qualified Domain Name (FQDN) for the hostname to be used during their licensing verification system. This article describes how to change a server hostname in CentOS.
Change a server hostname
- Using a text editor, open the /etc/sysconfig/network file.
HOSTNAME=value to match your FQDN hostname.
# sudo nano /etc/sysconfig/network HOSTNAME=myserver.domain.com
For internal networking, change the host that is associated with the main IP address for your server, (found at /etc/hosts).
hostnamecommand. This command lets you change the hostname on the server that the command line remembers, but it does not actively update all programs that are running under the old hostname.
Restart networking on your server to ensure that changes will persist on restart.
# /etc/init.d/network restart
Continue the conversation in the Rackspace Community.
©2016 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License