How to Change Hostname in CentOS 7

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

hostnamectl status

change your current hostname, execute the following command

[root@nod home]# hostnamectl set-hostname server1.mydomain.com --static

hostnamectl hostname update

That’s it! You’ve just changed your server hostname to server1.mydomain.com

Leave a Comment

− 2 = 2