Every server is started with the server’s given name as the hostname. Sometimes when the server host some softwares, such as cPanel, that requires a valid Fully Qualified Domain Name (FQDN) for the hostname to be used during their licensing verification system. So its important to set the FQDN hostname for your server .
Change a server’s hostname
First you have to Login to your server using root username privileges and edit the file /etc/sysconfig/network by running the following command
then you have to change HOSTNAME= value to your FQDN hostname for example:
Now you need to change the Hostname in the file hosts ,that file used for internal network mapping IPs by running the command
the new values of the content file should be
127.0.0.1 localhost localhost.localdomain
184.108.40.206 yourserver.mydomain.com yourserver
Now you can run the hostname command. This command 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.
Also you need to restart networking on your server to check that changes will persist on restart.
998 total views, 3 views today