- Newest
- Most votes
- Most comments
Hello.
I also tried ping google.com and it says Name of Service not known.
Name resolution may not be working properly on the EC2 OS.
Are "DNS hostnames" and "DNS resolution" enabled in the VPC where EC2 is running?
If this is not enabled, name resolution from EC2 will fail.
https://docs.aws.amazon.com/vpc/latest/userguide/AmazonDNS-concepts.html#vpc-dns-support
You can enable it by following the steps in the document below.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns-updating.html
Hi there,
Do you have custom NACL attached? Make sure your NACL is not using the default deny All
Hey!
So I managed to fix this issue. The problem was actually with my organization, apperently there is an extra layer of security which does not allow internet communication on VPC. I had to use a Security Group that is made by my company, it has 50 custom made rules which unfortunetley I am not allowed to share due to obvious security reasons. But I would suggest you re create your VPC, Instance and Security group. In my case I did everything correct but there was small issue which was blocking me from internet that was related to organization which am working for. So its very specific.
Hi Benjamin, were you able to get this resolved? I'm facing same issue.
I have NACL associated to the VPC and validated the outbound rules allows all traffic all ports all IP. I checked SG -> NACL -> IGW and all of it have outbound rules allowing. I detached NACL and tried only with SG and it is able to communicate. So I can say something is wrong with my custom NACL. Outbound rule to allow traffic is explicitly defined and this should ignore the default rule to deny all traffic, correct? Not sure if I'm missing something here.
Hi there, sounds like your NACL is blocking the traffic. NACL is stateless, so you will need to allow both inbound and outbound for the traffic to be allowed. e.g. when connecting out to the internet on port 80, you need to allow outbound port 80, and inbound on ephemeral port (normally 1024-65535)
Hi, thank you for the fast response!
Yes both DNS Name and Resolution are enabled in the VPC which I am using currently.
However I did saw something just now, when I click on the VPC's detail where my Instance is located, and then see main routing table of that VPC, I can see that its not associated with any subnet. Could that be the reason why I am not receiving any network connection in my EC2 instnace? I did created my own subnet and associated it with routing table as you saw on images I provide but I assume the main routing table perhaps should have the same configuration when it comes to associating it with subnet?
So again everything seems to check out, I posted below picture of my subnet where the EC2 is running. Maybe there is something I missed?
And my routing table associating with that same subnet:
Relevant content
- asked 6 months ago
Currently, SSH is available, so EC2 should be publicly accessible. If there is a problem with the route table, you need to check the route table associated with the subnet where EC2 is running.
Is it possible to resolve the name "google.com" using the "dig" or "nslookup" command?
If name resolution is not possible, try adding the IP of Google's name server as shown below to force name resolution. https://repost.aws/knowledge-center/ec2-static-dns-ubuntu-debian
By default, the settings are as follows. The IP address changes depending on the CIDR of the VPC you are using.
To begin with, I feel like there is a problem with the VPC CIDR. I thought there was a problem because it was outside the range of private IP addresses specified in RFC 1918. https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-sizing-ipv4
The CIDR of a VPC cannot be changed once it has been created, so you will need to recreate the VPC.