Home  >  Article  >  Operation and Maintenance  >  What should I do if Linux cannot ping the host name?

What should I do if Linux cannot ping the host name?

王林
王林Original
2020-05-15 13:35:495131browse

What should I do if Linux cannot ping the host name?

Problem restoration:

The Linux server cannot ping its own host name, as shown below:

What should I do if Linux cannot ping the host name?

Solution Method:

1. Modify the /etc/sysconfig/network configuration file

#vi /etc/sysconfig/network 
NETWORKING=yes 
HOSTNAME=ZWCLC6X-9232//在这修改hostname

2. Modify the /etc/hosts configuration file

# vi /etc/hosts 
127.0.0.1 localhost.localdomain localhost 
119.10.8.125  ZWCLC6X-9232 //在这修改hostname和你的IP对应关系

3. Restart the network service

# service network restart

Recommended tutorial: linux tutorial

The above is the detailed content of What should I do if Linux cannot ping the 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