Assalamu’alaikum Wr. Wb.
My machine running CentOS Linux release 7.3.1611 (Core). There are some different between redhat based version under 7 and and above 6, include the commands. In this case, I wanna change the hostname from jeruk.buah.net to rhino.animal.net. At the redhat based version under 7, I can change by /etc/sysconfig/network. So, how about version 7 and above? It replaced by hostnamectl command.
It is simple. Login as root in terminal and change the hostname by hostnamectl command:
hostnamectl set-hostname rhino
hostnamectl set-hostname rhino.animal.net –static
That’s it! and then change the /etc/hosts.
Logout and relogin.