CentOS: how to fix error ping Name or service not known?
[root@tutorialspots ~]# ping google.com ping: google.com: Name or service not known
How to fix it?
Check file /etc/resolv.conf:
[root@tutorialspots ~]# cat /etc/resolv.conf # Generated by NetworkManager search nocix.net nameserver 127.0.0.1
Add theses lines:
nameserver 18.104.22.168 nameserver 22.214.171.124
Done!, now you can ping
[root@tutorialspots ~]# ping google.com PING google.com (126.96.36.199) 56(84) bytes of data. 64 bytes from dfw28s05-in-f14.1e100.net (188.8.131.52): icmp_seq=1 ttl=52 time= 40.8 ms
But every time when you restart the computer your /etc/resolv.conf will be replaced by default.
Method 2: check your /tmp directory, it is full, delete some files
Recent search terms:
- ping name or service not known
- name or service not known in centos7