Manage the Hostname Using hostnamectl. You can run the following command to check for the current hostname
Confirm that your current hostname, execute the following command
[root@nod home]# hostnamectl
change your current hostname, execute the following command
[root@nod home]# hostnamectl set-hostname server1.mydomain.com --static
That’s it! You’ve just changed your server hostname to server1.mydomain.com