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