Linking Amazon Route 53 Domain Name to EC2 instance - amazon-web-services

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:
Launched EC2 instance and installed LAMP stack. I'm running a web app on the instance.
Associated an Elastic IP to the instance and I'm able to reach my web app using this IP address.
Registered domain name with Route53
Created a Hosted Zone with the same name of registered domain
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?

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
2. Copy those records to the appropriate domain 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).

Related

AWS route53 and dns setup

I registered domain with AWS and set Hosted Zone.
inside the hostedzone i have NS with 4 records and SOA as a record type
I added A record type and point it to EC2 public IP.
in browser i can not get response when type domain name.i got "This site can’t be reached"
search here and some people advice to check NS with dig command.
dig command answered when i run in on Ec2 Ubuntu command but didn't get response when run it on my laptop.
I have other sites on roure53 but new one doesn't work.
any thought?
How did you registered the domain? Did you purchase it from a website and paid for it?
From what you said, it seems the FIRST thing you did was creating a Hosted Zone in Route53. Let me explain.
Usually when we purchase a domain from another website, after paying for it and everything we will need to tell the Domain Registrar to use the Name Servers and input a value like ns1.abcdomain.com and ns2.abcdomain.com . The purchase of a domain name usually comes with a free DNS service, so it will already have a valid name servers defined.
If my guess is correct, you created a hosted zone in AWS Route 53 without actually paying and registering a domain with a registrar (AWS is also a registrar). Therefore the domain only exist in AWS world because you created a Hosted Zone.
This explains why running dig on your EC2 provided the expected IP, because somewhere along the line the EC2 reaches AWS internal Route53 DNS service before reaching the public internet for DNS result.
If you indeed paid AWS something like $12 to purchase a domain, you might have misunderstood their interface (which can be confusing sometimes) and missed appointing Route 53 to be the domain's Name Servers.

Namecheap Domain not working on AWS EC2 Instance

I am new to AWS and facing this issue for the past few days. So any help will be appreciated :)
I have created an AWS EC2 instance and deployed backend&frontend services on SINGLE INSTANCE that are used in my project.
Backend->Java,Apache tomcat,RDS,Elasti cache
Frontend-> Node
And now created a hosted zone under Route53 to host my Namecheap domain in AWS EC2.
Have checked all configs thrice, and added A type(Value as ec2 IP) and CNAME(Value as domain name e.g. xxyyzz.liv) type variables in the hosted zone including modifying nameservers from hosted zone to the Namecheap DNS settings.
Even after long waiting(of 48 hrs) my domain is not getting live, tried multiple times but no help.
This will be caused by misconfiguration. Perform the following steps to rectify this issue:
Ensure you have not replaced the NS or SOA records in Route 53, these should stay as the values that Route 53 generates. If you have replaced their values, create a new public hosted zone and migrate the records to this (excluding NS or SOA).
Run DIG against your domain for the MX record, either by running DIG NS example.com or by using an online tool such as https://toolbox.googleapps.com/apps/dig/. If you get no results back (returning a SERVFAIL) or incorrect name servers back then you will need to update the name server configuration.
Within your public hosted zone in Route 53 look for the NS record, copy the values (there will be 4 nameservers). Then within namecheap follow these instructions for "Custom DNS". Add each name server from Route 53.
By now running DIG again you should be able to see the records that should have previously been accessible. Depending on the TTL of the previous NS record you might find it takes a few hours/days for the DNS to migrate across, although you can clear the DNS cache on your local network.

route53 domain name is not connecting with my ec2 elastic ip

I'm running an ec2 instance. If I ping the instance based on its elastic IP I get a response. If I use my registered domain I can not access that elastic IP address anymore. In Route 53 (under the DNS Management) I have 1 hosted zone with 3 record sets:
an A record set with my domain and the elastic ip address
an automatically assigned AWS NS record
an automatically assigned AWS SOA record
So, basically the only entry I added was the A (that corresponds to the name of my domain and the elastic IP address as a value. Not sure why it's not binding.
My ec2 instance has no firewall and for the time-being both (the inbound and the outbound) sections of my aws firewall are set to "all traffic".
when I use a domain validator I do not get anything back. It behaves as if the domain did not exist. The domain was created over a year ago (so this is not a new domain). I checked in the dash-board and as far as I can tell all the information (contact info, verification info) looks fine.
Furthermore, the "test-record" feature in the Route 53 does return the IP address on a "UDP" port.
What am I missing? Do I need anything else?
Edited
Edited 2
I have deleted the 1 hosted zone and created a new: now it looks like this:
If you bought the Domain from other than AWS then you need to manually update its name server from their portal (godaddy,etc).
So this is how it goes in case of others:
create a Hosted Zone in Route53 which you already did
NS and SOA records will be auto-generated however, it's important to note that the auto-generated NS will NOT update the domain's NS automatically. You need to update it manually
Add A records as shown in image below
Then go to your domain portal and change DNS, use auto-generated DNS from Route53
Changes will be refreshed as per your selected TTL but it usually updated in 5 mins
OR
If your Domain provider gives you the access to setup records in their portal then you can skip all the above steps and simply create A record there with your elasticIP to point your domain to ec2
EDIT
As you can see in picture nameservers mentioned on the top right corner of the image are different than your record NS, your NS records are wrong.
It's better that you delete this hosted zone and create new Public Hosted Zone. You will get new NS after creating a Hosted Zone then just go to domain editing and update nameservers with the new one on domain.

How can I set up DNS for my website?

I have a specific DNS problem for my website - I can access my website using its static ip address but not its domain name. Here's a description of my situation:
I registered a website name, say, "xxx.com", at GoDaddy.com, but the web app is hosted on a AWS lightsail Ubuntu instance with a static ip;
In the "DNS Management" page of this same on GoDaddy.com, I specified custom name servers as those provided by AWS
On AWS Lightsail, I then created an "A" DNS record that maps "xxx.com" to the ubuntu instance's static ip: "A" - "xxx.com" -> "x.x.x.x"
I was able to reach my website using "xxx.com" last night, but after rebooting the Ubuntu instance this morning, the domain name is unreachable while the website can still be accessed using its ip address
I have 2 questions -
How would AWS' name servers know that I am the rightful owner of this purchased domain name "xxx.com", by allowing me to map "xxx.com" to a certain ip address?
Did I miss something during the process above that made my website unreachable today using "xxx.com"? Why was it working yesterday but not today??
Any thoughts would be appreciated. Thanks in advance!
I can now partially answer my own question #2, and the answer is DNS propagation.
When DNS changes are made, it might take up to 24 hours for the DNS changes to take effect across the internet. Both name servers and one's local DNS cache will need to refresh first before receiving newly changed DNS records.

Domain name not showing up in DNS

It's been couple of days that I transferred my domain name from one AWS to another--dev environment to production. The problem is, the domain name isn't showing up in any DNS (Amazon or Google). I'm pretty sure I've configured the hosted zone correctly.
I'm also trying to verify SES which is failing and I also set MX records (Gmail) which don't work. The MX records and SES were set couple of days ago. Additionally, I created an A record to point to a elastic load balancer DNS name.
Any suggestions on what might be the problem? It's been couple of days and from past StackOverflow posts as well as past experience, DNS propagation on Amazon's server doesn't take more than 15 minutes.
EDIT:
Here is a timeline of events which can provide more information:
I had a domain abc.com on AWS account user1
The domain was transfered to AWS account user2
As of right now, the following hosted zone is created on user2's account:
The one thing this record set is missing is a CNAME to the load balancer which I had setup when the domain belonged to user1. However my understanding is that an A record should be good enough and it was a mistake on my part.
I'm using Windows and so I've flushed my DNS. I've tried looking up using AWS's DNS servers and Google's DNS server and nothing.
C:\>nslookup abc.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
*** google-public-dns-a.google.com can't find abc.com: Server failed
It's been a couple of days since the domain was transferred. MX records were something I setup immediately and so I haven't gotten an email. If the DNS doesn't have any clue about the domain name, something must be wrong.
NOTE: The domain name is obfuscated to abc.com.
As suggested by #michael-sqlbot, the name servers were different in the console and hosted zone. I updated the name servers to the NS of the hosted zone. I see DNS propagation.