amazon-web-servicesamazon-ec2ping

Ping from a public EC2 instance


I created a public instance and attached a security group in it. enter image description here

The SSH is for connecting to the EC2 instance itself through the management console, and the ICMP is for the ping request.

However, I am getting the following error.

enter code here[ec2-user@<IP_OF_THE_EC2_INTANCE> ~]$ ping google.com
 ping: google.com: Name or service not known

Why is this happening?


Solution

  • The error google.com: Name or service not known basically means that the ec2 instance cannot resolve the google url. You need to check your DNS configuration.

    You could also try to ping an IP, instead of a URL to see if you have a network connectivity issue as well. Try pinging some famous IP, like: ping 8.8.8.8 If that also fails as well, you should try to fix the network problem first.