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