How to change hostname on CentOS7

Simply run:

# hostnamectl set-hostname <HOSTNAME>

And then logout and login again.
Server name should be changed without reboot.

Leave a Reply

Your email address will not be published. Required fields are marked *