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

How to modify centos host name

WJ
Release: 2020-06-03 15:32:03
Original
2292 people have browsed it

How to modify centos host name

Step one:

hostname myhost
Copy after login

Step two:

修改/etc/sysconfig/network中的hostname
vi /etc/sysconfig/network
HOSTNAME=myhost  #修改localhost.localdomain为myhost
Copy after login

Step three:

修改/etc/hosts文件
vi /etc/hosts
127.0.0.1  myhost localhost  #修改localhost.localdomain为myhost
shutdown -r now
Copy after login

#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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template