Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking Amazon Route 53 Domain Name to EC2 instance

I have registered a domain name with Amazon Route53 and I'm trying to link it to an EC2 instance. I'm unable to do this successfully. I have read documentation many times over, I have looked at many tutorials online, I have read many stack overflow answers. I still haven't been able t figure it out. Help will be greatly appreciated.

What I have done so far:

  1. Launched EC2 instance and installed LAMP stack. I'm running a web app on the instance.
  2. Associated an Elastic IP to the instance and I'm able to reach my web app using this IP address.
  3. Registered domain name with Route53
  4. Created a Hosted Zone with the same name of registered domain
  5. Created a Record Set with the following info:
    • Name: example.com (of course not literally, I have my domain name here)
    • Type: A - IPv4 address
    • Alias: No
    • TTL(Seconds): 300
    • Value: Elastic IP of EC2 instance
    • Routing Policy: Simple

This is the point at which I am stuck. When I run nslookup example.com DNS server name in terminal I get the desired response. Running dig domain name, as expected returns no answers. How do I finally connect the Hosted Zone to my domain name to get the latter pointing to my EC2 instance?

like image 402
dela vee Avatar asked Nov 23 '15 17:11

dela vee


1 Answers

Documenting the solution as an answer. It sounds like you got everything correct except hooking up the hosted zone Name Servers to the domain name. This is done via NS Records. When you create a new hosted zone, it automatically assigns you Name Servers. To link the two together, you need to enter the NS records under the "Registered Domains" area.

1. First get the NS records from your hosted zone

NameServers under Hosted Zones

2. Copy those records to the appropriate domain under "Registered Domains".

NS Records under Registered Domains

Note: NS Record TTL (time to live) can be as high as 72 hours (rarely), so it could take a significant amount of time for the change to be reflected in a lookup tool like dig (or browser).

like image 158
jpschroeder Avatar answered Sep 30 '22 18:09

jpschroeder