Change computer name in Linux system

1. Log in as root user, then enter the hostname command at the prompt, and you can see that the hostname of the current system is iZwz91wwk16wo0m48ikkaxZ (I use the Alibaba Cloud server), as shown in the following figure:

hostname

2. Change the network file under /etc/sysconfig and change the value after HOSTNAME to the host name you want to set.

vim /etc/sysconfig/network

     I changed it to the default localhost.localdomain of the Linux system here

3. Enter the reboot command at the prompt, restart the server, and the new computer name will take effect.

reboot

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325432234&siteId=291194637