Friday, April 22, 2022

ping: Name or service not known

Recently I encountered a stupid situation on Oracle Linux 8, when I wasn't unable to connect from OL8 server to another server via its dns name. For example

# ping www.google.com
ping: www.google.com: Name or service not known

The cause was very simple : the space before word 'nameserver' in the /etc/resolv.conf file. The contents looked like :

; nameserver 192.168.56.1
 nameserver 192.168.0.1

After correction the mentioned file started to look like :

; nameserver 192.168.56.1
nameserver 192.168.0.1

And all started to work as expected :)

# ping www.google.com                  
PING www.google.com (142.250.184.196) 56(84) bytes of data.
64 bytes from fra24s11-in-f4.1e100.net (142.250.184.196): icmp_seq=1 ttl=63 time=42.4 ms
64 bytes from fra24s11-in-f4.1e100.net (142.250.184.196): icmp_seq=2 ttl=63 time=42.1 ms

Good Luck !

 

No comments:

Post a Comment