Home >Operation and Maintenance >CentOS >How to modify centos host name
Step one:
hostname myhost
Step two:
修改/etc/sysconfig/network中的hostname vi /etc/sysconfig/network HOSTNAME=myhost #修改localhost.localdomain为myhost
Step three:
修改/etc/hosts文件 vi /etc/hosts 127.0.0.1 myhost localhost #修改localhost.localdomain为myhost shutdown -r now
#Finally, just restart the server.
Related recommendations: centOS tutorial
The above is the detailed content of How to modify centos host name. For more information, please follow other related articles on the PHP Chinese website!