How to Change Hostname in CentOS 8. A hostname is a label that identifies a machine on a network. In CentOS 8, you can change a hostname or computer name using nmtui or nmcli.
Changing hostname using nmtui command is pretty simple. But, make sure you are logged in as a user with sudo privileges.
Run this command
Then just simply change the hostname.
Or,the second option is using nmcli.Type this command
sudo nmcli general hostname linuxsec
Ok. So, that’s for today. Ask me everything if you have any problem with this tutorial. And dont forget to share it if you think it is helpful. Thank you and see you in the next tutorial.