Home  >  Article  >  Operation and Maintenance  >  How to modify centos host name

How to modify centos host name

WJ
WJOriginal
2020-06-03 15:32:032185browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn