ALIAS record pointing to AWS endpoint, bad idea? - amazon-web-services

We have an AWS RDS Multi AZ deployment and one of our teams is using a subdomain (rds1.company.com) to access it. The subdomain uses an ALIAS record to point to the AWS endpoint and when I replaced the instance with a restored snapshot last week, it took at least an hour to refresh and point to the new instance.
Since the idea of a Multi AZ deployment is so that the endpoint can point to the fallback server whenever needed, isn't a custom domain a bad idea? I was told by our network admin that the ALIAS record refreshes once an hour.

Route53 ALIAS records have a fixed TTL of 60 seconds. This is stated in the Route53 FAQ. Public Internet DNS servers often times ignore the TTL.
Route53 ALIAS records do not support RDS, so you are most likely using a CNAME with a TTL of 3600 seconds. The TTL (expiration) can be set as short as 1 second but Amazon recommends a minimum TTL of 10 seconds.
Multi-AZ RDS endpoint will failover automatically in less than 60 seconds with Aurora and as fast as 30 seconds with MariaDB Connector/J. Other instance types can take from one to two minutes. This is covered in the RDS FAQ.
Make sure that the Route53 CNAME record is using the RDS DNS Name (endpoint) and not the IP address. You can set the CNAME TTL to be a small as you need.
Amazon Route 53 FAQ
Amazon RDS FAQs

Related

Connect AWS Hosted Zone To Registered domains

I want to connect my domain (in AWS Registered Domains) to the IP address of my Ec2 instance in my AWS account; so that I can type www.my-domain.com in any browser and open my website.
I transferred a domain name from my old AWS account to a new one. Usually AWS creates a hosted zone for the domain automatically, but it didn't.
So I created my own hosted zone and and added and two A records (www.a.com and a.com) with value connected to the IP address of my Ec2 instance but the browsers didn't recognize the domain.
So I tried:
Updating the Name servers of the hosted zone to be the same as the domain name NS But same result
Updating the Name servers of the domain name to be the same as the hosted zone NS But same result
What can I do?
Thanks.
As long as the domain registrar is AWS (you can validate this by running whois against your domain) the setup should be quite simple.
Firstly it might be worth creating a new hosted zone if you've modified the NS records for it. It is important that these values are the original domains that AWS entered against the values. Also ensure the hosted zone is a public hosted zone.
Copy each of the nameserver values from your public hosted zone (there should be 4 in total). Then on your registered domain in the Route 53 console, edit the nameservers replacing the values with the values that were taken from your hosted zone. Once you have done this the new public hosted zone will be used by your domain.
Depending on any TTL caching you might find it can take a little time for clients to use this nameserver but you can test it by using a DIG command to find the NS value using an external server or the web service offered by google.
I don't know if this could count as and answer but this is what I did to fix the problem:
I created and Application Load Balancer
With Security Group with Inbound rules: HTTP TCP 80 0.0.0.0/0, ::/0
And Target Group TCP 80 Set to Ec2 instance.
Connect the A record to the ALB
This fixed my problem

Can I use AWS Route53 registered domain in another AWS account?

Haven't seen something like this (Hosted zone transfer maybe?), so I'll try here.
I have a pretty straightforward question, so I am hoping that someone can answer it or has any experience with the same case.
I have registered the domain using Route53 DNS service on one AWS account. I would like to use that registered domain on another AWS account, using it primarily for creating CNAME records for the load balancers. I have updated the NS records for the domain to match the second AWS account NS records and I am able to use and created hosted zone in that second account, but the CNAME or # records are not resolvable.
This can sometimes be tricky so I am going to cover the initial steps.
You create a new hosted zone in Account B
You add that hosted zones NS record in Account A. This is a new NS record in the master record (mydomain.com)
You then add an alias for your load balancer on your hosted zone in Account B.
It looks like you are doing all of this so a few other things you can check:
The security group associated with your ELB allow port 80 or 443.
The public subnets associated with your ELB have routes to the internet gateway.
The NACLs on your subnets allow port 80 or 443.

aws charging me for dns query

I have an ec2 instance under the free tier of aws and I am using route 53 hosting with it. In my bills, I am seeing charges for DNS-queries. But I don't get these on other servers I own on other accounts. Is it because I have configured it wrong? Please help
If you are using an A-record, then there is a charge ($0.40 per million queries).
However, as per the Route 53 pricing page:
Queries to Alias records that are mapped to Elastic Load Balancers, Amazon CloudFront distributions, AWS Elastic Beanstalk environments, and Amazon S3 website buckets are free.
To use this, select "Alias = Yes" and point to one of those resources. (But it appears an EC2 instance is not one of them, unless fronted by a Load Balancer.)
Worst case... pay the 40c!

How does Route 53 charge?

I bought a domain not from AWS and setted it up using route 53 with amazon. The ec2 instance is just running from 2 days without any server running on it (I'm still working on the coding part) but I setted up route 53. Today in my billing I saw this:
How does it work? I'm still in free tier so I'm not sure if it was covered or not. Even if it was, how did AWS charged 50 cents for 2 days routing when no one visited my site and nothing was running on the ec2 instance? Can somebody explain?
Most likely the minimum charge for DNS queries or/and for your hosed zones. If you go to billing dashboard, you will clearly see the itemized charges under Route53. I see the following itemized charges in my billing dashboard. Even if your dig your DNS, it is considered as a query.
Route53 charge you for creating a Hosted Zone (Which is essential to use Route53 Service) which is not under the free tier category. It seems, you were charged for the Hosted Zone created, which is a monthly recurring charge of $0.5 per month, per hosted zone.
Additionally Route53 charges for data transfer as well and for detailed pricing, check this link.

Why does AWS Route53 not keep consistent DNS zones?

In a setup with EC2 instances, and a properly configured zone file, I've found that AWS periodically changes their DNS servers. This means one has to go all the way back to the initial ISP setup and update those DNS records every time they change.
This ISP (and most every ISP) actually allows you to set up private DNS nameservers, but this only works if the DNS servers (addresses) are consistent. Otherwise the site will become completely unreachable when AWS randomly changes their zone files/DNS servers. Is there any way around this?
The IP addresses of Route 53's name servers assigned to your hosted zones should not change. I would post to the Route 53 forums explaining what you are seeing.