AWS VPC External DNS issue

amazon-vpcamazon-web-servicesdomain-name-system

I have booted up an instance in side a private VPC. I assigned an ElasticIp address to it and I can ssh into the instance with no issues. However, DNS is not resolving 🙁

in my /etc/resolv.conf I have

nameserver  172.16.0.23
domain eu-west-1.compute.internal
search eu-west-1.compute.internal

but when I try and ping 172.16.0.23 I get

icmp_seq=156 Destination Net Unreachable

Which makes sense as I have no route to that private subnet. I can ping any external ip address i.e

ping 173.194.69.139

but I cannot

ping google.com

I created the VPC using the wizard I assume that the VPC is assigning the /etc/resolv.conf settings.

and the documentation says I should have external dns access, but I don't.

Can anyone help?

Best Answer

In the VPC Service control panel you can create DHCP Options Sets. Create one of those with the nameservers you want to use.

Then, under "Your VPCs", change the DHCP Options Set in use by your VPC to be the new one you just created.

If you are going to have more than a few servers in your VPC, you might want to consider running your own internal caching DNS resolver.