linux centos 7 change hostname code example
Example 1: set hostname centos 7
hostnamectl set-hostname <mention the host name>
Example 2: linux change hostname
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot
hostnamectl set-hostname <mention the host name>
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot