domain won't resolve to aws ec2 - using route 53 and elastic ip

zenthara picture zenthara · Jun 28, 2013 · Viewed 8.5k times · Source

I struggle to connect my domain to my ec2 instance, although I have read every post on the internet i could find about the subject:

I am using Route 53 to route my domain to an Elastic IP, which is assigned to an EC2 Ubuntu 13.04 instance. nslookup for the domain from outside shows the Elastic IP address, but returns Server UnKnown.

My setup is as follows:

  • Domain All four Route 53 delegation set entries added as nameserver, DNS lookup shows everything is distributed and fine

  • Route 53: A record sets for domain.com and *.domain.com, pointing to the Elastic IP

  • Elastic IP: Assigned to the EC2 Instance

  • EC2 Instance: Ubuntu 13.04 with LAMP (MySQL disabled), vHost set for *.domain.com and enabled, added 127.0.0.1 domain.com to etc/hosts file, everything restarted and set up

Entering the Elastic IP or the direct Instance IP works just fine, only use of domain returns "Cannot resolve hostname".

I would really appreciate any help on this.

Answer

Charles Engelke picture Charles Engelke · Jun 28, 2013

The EC2 instance and Elastic IP are fine, or else you wouldn't be able to connect with the IP address. The problem is with DNS.

I don't understand how DNS lookup can show everything is fine, but you get "Cannot resolve hostname". That's saying that your local computer cannot convert the name you've assigned to an IP address. That means something is wrong with DNS.

Are you sure that you've registered your name servers with your registrar correctly? You said that DNS lookup says things are fine. If so, then the problem must be in Route 53.

Are you using * as a host name in Route 53? If so, replace it with a simple word (like www) and see if that works.