CentOS 8 Change Hostname (computer name) command

To change the hostname on a CentOS 8 system using the command line, you can use the hostnamectl command.

To set a new hostname, use the following command:

sudo hostnamectl set-hostname newhostname

Replace newhostname with the desired hostname for your system.

To verify the hostname change, use the command:

hostnamectl

It will show the current hostname of your system.

Leave a Comment