How many subdomains we can create in Route 53 AWS DNS service? - amazon-web-services

In my application, I'm giving a subdomain (like user.domain.com) to each account. So, I'm planning to use AWS Route 53 for routing subdomains to my application. Is there any maximum limit of subdomains in Amazon Route 53.
Thanks in advance!

I'm giving a subdomain (like user.domain.com) to each account
You should revise your application design what If you users reached to million? and what if you want to migrate your DNS in future also subdomain maximum limit varies from service provider to service provider.
So generalize solution cloud be like all subdomain will point to a single endpoint (Load balancer) and your core backend will check DNS and then load custom response base on the domain, normally login page for which you can save custom logo etc against domain name and load these resources base on domain.
High-level architecture
So same case for a big cloud service provider, for example, slack, which provides subdomain for each user but do we think that slack manages route53 record for each users?
how-slack-works
Or you can simply do nslookup, for thousand domain you will get the same backend IP.
slacker:~$ nslookup acmeinc.slack.com
Name: acmeinc.slack.com
Address: 13.228.49.204
slacker:~$ nslookup www.slack.com
Name: www.slack.com
Address: 13.228.49.204

The Route53 limits and quotas are listed here.
The limits are not expressed directly in number of subdomains, but rather in number of records and hosted zones, among other things.
Therefore, there is 10,000 records per hosted zone, but it can be increased. Also you can have 500 hosted zones per account.

This might be relevant or not depending on your use case, but if you expect a large number of users and want to assign a custom subdomain per user, then the limit of 10,000 is probably not sufficient for you.
Your other option is to create a CNAME record with a wildcard subdomain, something like *.domain.com, and point the record to your application, this is now supported by AWS Route 53 and will support all possible subdomains.
The drawback is that subdomains that are not registered will also be directed to your application (like random-str.domain.com), so you'll need to do your validation outside of Route 53. Maybe call an API to validate from your frontend app

Related

The proper way to copy DNS addresses in Route 53 - Copy from the hosted zone or copy from where the domain is registered?

I am playing with hosted zone creation and domain name servers.
Everything I have has been created in AWS (the registered domain and the hosted zone).
I am not sure about DNS when I create a hosted zone.
1 - Do I copy the DNS records from the Route 53 hosted zone that I created for the domain and add them to the DNS list where it domain is registered (which is also in AWS under Route53/registered domains) .
or
2 - Do I copy the DNS records listed from the registered domains page and replace the DNS addresses that are into the route 53 domains hosted zone?
Does it matter? Can I do it either way and it is ok as long as they both match with the same DNS servers?
Eventually I am going to need to create hosted zones for subdomains in a different AWS account than what the domain and hosted zone is registered in and wondering what the best way to handle this would be.
AWS account A - This is where the domain is registered and where the domain has its hosted zone created. - Lets call the domain ernie.com (not the actual domain I am playing with)
AWS account B - This is where I want to created the hosted zone qa.ernie.com
Since we might also want to create more subdomains later on, it just seems easier to be able to get the list of the four DNS servers from the registered domain and use them every time we create a subdomain hosted zone. That would be instead of appending the DNS list of the registered domain with each subdomains DNS list - I assume that list could get pretty long then.
I have played a bit and no know matter which way I try it I am not seeing my domains DNS when I look at the domain with a dns look up website so I am wondering what might have happened there.
FYI - This will all be done with Terraform once I figure it all out - in case some has a great example for me to look at with Terraform IAC.

Is it possible to use hostgator domains on AWS

I have an application that I want to launch on AWS. This application must have a domain that would allow me to create hundreds of thousands of subdomains.
Now, Hostgator allows you to purchase a domain that you can create an unlimited number of subdomains.
Is it possible for me to transfer my subdomains created on Hostgator to AWS?
Jordanm makes a few good points in the comments.
We need to distinguish between the registrar and the DNS provider that hosts the domain.
The registrar allows you to buy a domain, which is then registered to you and allows you to use it.
In order to use that domain, you need a name server (in practice it's more than one) that can respond to requests for that domain.
You can tell the registrar what the name servers for your domain are and for this you set the NS (short for - you guessed it - name server) records for your domain to point to your name server.
This name server can then create as many subdomains as it likes, because it will be the authoritative source for others to find these subdomains.
Many registrars also host a name server for you and some limit the number of subdomains.
If that's the case for your registrar, you can just use another DNS service and tell your registrar that the other DNS service is now responsible for your domain.
In the case of AWS, you would create a public hosted zone for your domain in Route 53.
It will then tell you, which NS records to configure with your registrar.
When you've done that, you can manage your domain and subdomain in Route53.
You can also directly buy a domain in Route 53, because AWS acts as a registrar as well.
(A little bit simplified, but that's basically the process)

Multiple Domains Pointing to Same AWS Route 53 Hosted Zone

We have two domains: oursite.org and oursite.com.
Both domains are managed by Google Domains.
DNS service for oursite.org is provided by AWS Route 53. We would like to migrate DNS service for oursite.com to AWS Route 53 as well.
For oursite.org we simply set four custom name servers in Google Domains to point to our AWS Route 53 hosted zone.
Can we simply set the same four custom name servers for oursite.com in Google Domains? Or do we need to create a second hosted zone in AWS?
(we'd like both domains to point to the same website)
These are 2 differents domains, it's not like sub-domains, so I think you will need 2 hosted zones.
I'm not sure since your problem seems to be on GCP and I don't tweak that much in DNS these days, but Route53 gives you Reusable Delegation Sets that might solve your problem (and so yes, you might need a 2nd hosted zone with same name servers). See Configuring White Label Name Servers
As said Asdfg, you can think about redirection, but setting it in the DNS seems more efficient.

Managing only a subdomain in Route53

My website's domains are currently managed by a domain provider called mijndomein.nl. The aws hosted services are connected simply by subdomains using elastic-IPs. Because of some infrastructural changes, I'd like to start using Route53 for certain subdomains. As there are several other things managed by the domain provider and changing the whole infrastructure all at once seems dangerous, I'd like to manage only some subdomains in Route53.
I found this video, which shows how to manage the whole site in Route53 by adding the Route53 name servers for the custom domain provider.
My first question is if it's possible to keep the already existing subdomains at my domain provider and manage only specific subdomains in Route53? If I add the aws nameservers will my domain provider continue to route to elastic-IPs?
1) Yes
2) Yes, but be careful here: you don't want to change name server for your (root) domain name like they did at 2:58 of that video. Instead you have to go to DNS service provider's console (DNS service provider may or may not be the same place where you registered your domain - from mijndomein.nl web site it looks like they only offer domain regitration but I may be wrong) - that is the same console where you point your usual hostnames (www.example.com for example) to IP addresses, but instead of A record you will create a NS record(s) that will delegate your newsubdomain's name resolution to appropriate AWS name servers.
newsubdomain.example.com NS ns-xxx.awsdns-yy.com
newsubdomain.example.com NS ns-aaa.awsdns-zz.org
newsubdomain.example.com NS ns-bbb.awsdns-qq.net
newsubdomain.example.com NS ns-ccc.awsdns-pp.co.uk
(example)

AWS Multiple domains pointing to same server

I'm building a solution that will be provided to several companies. Any company will have to point their domains (or just a sub-domain) to my server and then I'll handle pages to their customers.
I'm testing it with the following config:
CustomerABC.com pointing to one hosted zone into Route 53
CustomerDEF.com pointing to another hosted zone into Route 53
Both hosted zones have an A record pointing to the same EC2 server instance
That said, every customer that wants to use my service will have to change its domain's DNS to his own hosted zone in my Route53. My server will handle many domains.
I'd like not having to create a new hosted zone for every new customer. Is there any way to achieve the same result?
Put Elactic Load Balancer in front of your application instance (even if you will use only one instance at the beginning).
Using your domain (the zone does not have to be hosted on Route53), create one CNAME (or ALIAS) record (for example myapp.example.com) and point it to your load balancer's domain name.
Simply tell your customers to CNAME their subdomain to your app dns name
If a business I was looking to do business with told me I needed to create a new zone on my DNS to access an application, I would very quickly move my business elsewhere! Especially if they wanted control of that zone, there are big security issues in allowing that. You will almost certainly lose business if you make that a requirement.
This is a commonly solved problem for thousands of businesses across the internet, you simply tell them to point their domain to your servers and you figure out which customer is which. Either by using something like the HTTP Servername field, or having some manner of authentication process that differentiates them from the other users.
By far the simplest method is having a CNAME record that you point all of your customers to. Depending on your business model it can be useful to give each customer a custom CNAME, some random unique ID, so if you need to expand and move clients in future you can do them a number at a time.
Look around at your competitors, or just generally around other businesses that have similar web models. Understand how they engineer their infrastructure and emulate that. But taking a whole DNS zone, is a really bad idea.