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 22.214.171.124 nameserver 126.96.36.199
Done!, now you can ping
[root@tutorialspots ~]# ping google.com PING google.com (188.8.131.52) 56(84) bytes of data. 64 bytes from dfw28s05-in-f14.1e100.net (184.108.40.206): 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:
- centos ping name or service unknown
- name or service not known centos 7
- name or service not known ping centos 7
- ping google com name or service not known in centos 7