How to change your hostname in CentOS
Open the /etc/sysconfig/network file with your favorite text editor. Modify the HOSTNAME= value to
match your FQDN host name.
# nano /etc/sysconfig/network
Change the host that is associated to your main IP address for your server, this is for internal
networking (found at /etc/hosts):
Hostname Command Line Change
The ‘hostname’ command will let you change the hostname on the server that the command line
remembers, but it will not actively update all programs that are running under the old hostname.
# hostname myserver.domain.com
At this point all the necessary changes that needed to be made have been made, you will want to
restart networking on your server to make sure that changes will be persistent on reboot:
# /etc/init.d/network restart
- I have a dedicated server with Plesk 8.x. how can I change the hostname of my server from IPAddress.dedicated.abac.net to a domain name which I currently own?
- How to change your server's hostname in Plesk
- Getting Started with CentOS 7
- How to change the primary IP addres of a WHM/cPanel server
- How to set the hostname of a machine