To view the current hostname, enter the following command:
In CentOS 7 to change the hostname and use the command hostnamectl# hostnamectl
Manual method to setup a CentOS 7 hostname is to edit the /etc/hostname file and type your new hostname# hostnamectl set-hostname server.domain.com
System reboot is necessary to apply new hostname.# vi /etc/hostname