How to modify the Linux host name

  
 

Step 1:

Modify hostname

vi /etc/sysconfig/networkHOSTNAME=localhost.localdomain in /etc/sysconfig/network #Modify localhost.localdomain to bingyang

Modify the HOSTNAME item of the network. The front of the point is the host name, followed by the domain name. No point is the host name.

This is a permanent modification that takes effect after a reboot.

Step 2: Modify the /etc/hosts file

vi /etc/hosts127.0.0.1 localhost.localdomain #Modify localhost.localdomain as bingyang

shutdown -r now Finally, restart the server.

Copyright © Windows knowledge All Rights Reserved