Home > Operation and Maintenance > CentOS > 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
Release: 2020-06-06 16:40:41
Original
3393 people have browsed it

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
Copy after login

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
Copy after login

Change to:

hosts: files dns wins
networks: files
Copy after login



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!

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