1. Log in to the system remotely.
2. Use the hostname command.
hostname zhaomu.com
3. Edit the /etc/hosts file. Replace the old hostname with the new hostname.
4. Edit /etc/sysconfig/network. Change the value of the HOSTNAME parameter to the new hostname.
5. Use the hostname command to check whether it takes effect.
1. Log in to the system remotely.
2. Use the hostnamectl command.
hostnamectl set-hostname zhaomu.com
3. Use the hostname command to check whether it takes effect.
1. Log in to the system remotely.
2. Edit the /etc/hostname file. Replace the old hostname with the new hostname.
3. Edit the /etc/hosts file. Replace the old hostname with the new hostname.
4. Execute the hostname.sh script.
/etc/init.d/hostname.sh start
5. Use the hostname command to check whether it takes effect.
The above is the detailed content of How to change the hostname of Linux cloud server. For more information, please follow other related articles on the PHP Chinese website!