The best way to change hostname on CentOS 7 is editing the actual file that controls the hostname. vi /etc/hostname Originally, it is: localhost.localdomain But, we’ll delete that line and change it to: buhpc2 buhpc is our hostname, but it also has the subdomain, 2.buhpc.com, that I have configured. Now, the second file that we also have to change is /etc/hosts. vi /etc/hosts The original file looks like:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
You create a new line with IP address hostname subdomain. If...