Resolve Public DNS Names via VPN in AWS

amazon-web-servicesdomain-name-systemvpn

I want to connect to my VPC via client VPN and use my local mysql client to access my RDS instance. I am also hoping that I can ssh into my servers using their public DNS name. My client VPN endpoint is configured to give me a IP from the pool (not used by any VPC subnet!): 172.1.0.0/16

Its is associated to subnet 172.2.0.0/16

I have set authorizations and added routes to access:

172.2.0/16 (default route)
0.0.0.0/0 (internet access)

I allow all traffic from my VPC endpoint security group to the DB & Servers.

I am able to connect the VPN. I get a IP address from the 172.1.0.0/16 CIDR range. I can access the internet while VPN is connected. I can ssh onto my servers using their private IP's.

I played around with a Route 53 inbound resolver but that did not affect anything.

Best Answer

An easy solution can be use VPC's default DNS resolver in your VPN's DNS settings.

What is your VPC's CIDR range? E.g. if it is 10.0.0.0/16 then the default resolver would be at 10.0.0.2. This IP can be added into VPN's DNS configuration to automatically resolve the DNS.

Credits: http://www.tothenew.com/blog/resolving-private-dns-queries-using-aws-vpc-resolver/

NB: I will update this answer when I find a good solution with Route53 resolver.

Related Topic