Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that centos cannot ping the domain name

How to solve the problem that centos cannot ping the domain name

WJ
WJOriginal
2020-06-06 16:40:413203browse

How to solve the problem that centos cannot ping the domain name

How to solve the problem that centos cannot ping the domain name?

Step one:

Check vi /etc/sysconfig/network-scripts/ifcfg-eth0

View the network card configuration Is the dns consistent with nameserver in vi /etc/resolv.conf;

If it is inconsistent, please change it to be consistent and restart the network card. Note that the first DNS is Mainly, it must be correct!

systemctl restart network

If the first step still does not work after processing, please perform the second step:

The second step:

vi /etc/nsswitch.conf
hosts: files dnsnetworks: files

Change to:

hosts: files dns wins
networks: files



If it is different, just add wins after the original line of hosts:.

Related references: centOS tutorial



The above is the detailed content of How to solve the problem that centos cannot ping the domain 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