Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 293
zenthara Avatar asked Jun 28 '13 18:06

zenthara


People also ask

How do I connect Elastic IP to EC2?

To associate an Elastic IP address with an instanceOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Elastic IPs. Select an Elastic IP address and choose Actions, Associate address. Select the instance from Instance and then choose Associate.

Why can't I access my website that uses Route 53 DNS services?

Check the website's public hosted zone resource records sets Verify the public hosted zone for your website's domain name in Route 53 is populated with the appropriate resource records sets. To update the values for records sets, see Editing Records.


1 Answers

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.

like image 147
Charles Engelke Avatar answered Sep 21 '22 11:09

Charles Engelke