Managing only a subdomain in Route53 - amazon-web-services

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)

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.

Can we use to different NS for domain and sub-domain

I am building an application, for that I am using serverless and netlify. so for the api which is using serverless I want to use sub-domain api.example.com and for dashboard I want to use example.com via netlify,
I purchase the domain via Route53, so that I can use the serverless, but to use netlify I update the domain name server to netlify name server , and I lost the sub-domain in serverless.
Could it be possible to have two different NS for domain and sub-domain ?
It is possible to to have different name servers for domain and subdomain. You have got to understand the resolution process though.
DNS query goes like this .com -> example.com -> api.example.com
As I understood how you have currently configured your DNS:
example.com -> Delegates to Netlify name servers.
Any further subdomains (like api.example.com) will then further be looked into Netlify NS records. If you want to go back to your AWS account again, for that you need to have further delagation for "api.example.com" in your Netlify NS's pointing back again to your hosted zone in AWS.
Why don't you just use one provider and then configure the A record and subdomains from the same place?
You can have multiple name servers (for redundancy) but I don't think you want to point a domain and multiple providers. One pointed at GoDaddy and one pointed at Route 53. I'm not sure that would work. Even if it could work, you probably won't want to do that.

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)

How do I configure CNAME for S3 websites

I am trying to host my static website using S3. I have a domain that I bought outside of AWS. The URL for my bucker http://my-website.com.s3-website-us-east-1.amazonaws.com. My domain name is my-website.com. I have tried everything but I cannot wrap my head around how I should be configuring CNAME so that my URL does not look messed up. I tried forwarding but that does not work for obvious reasons.
Please suggest solutions.
It depends on what your DNS provider is
You're using Route53 then you need to go to the Hosted Zone for my-website.com and add a A record for my-website.com that points to the bucket. You must set Alias to true for this to work.
If you're using a different DNS provider you can't route Apex domain (my-wesite.com, without www, or another subdomain in front). You'll be able to add a CNAME record for a subdomain that points to the S3 web endpoint.

How can we make DNS entries using Route53 to a domain hosted with an external (third party) domain provider

We have purchased a domain lets say "xyz.com" from a third party domain provider. We have our resources in two AWS regions and we want to implement failover between the two regions using Route53.
We have created a hosted zone with the same name as of our domain i.e. "xyz.com" and created record sets in the hosted zone with failover as the routing policy.
But as our domain is external the record sets are not getting reflected.
Please suggest a way to achieve failover using route53 with domain hosted with an external provider without moving the DNS to Route53.
You won't be able to do this without switching to Route53 to host your domain. Route53 must be able to control the responses to queries according to the records you have configured. You'll have to delegate your domain to Route53 by setting the NS records to the values provided in the Route53 console.
If you don't change your DNS Nameservers to Route53 then that zone will have no effect.
You could however register a subdomain in Route53, e.g. myapp.xzy.com, and delegate that subdomain/zone in your third party domain provider to Route53. You may also add a CNAME in the main domain pointing to a record in the subdomain.
To Summarise:
Create a Hosted Zone in Route53 for myapp.xyz.com
In that zone add the two DNS records with a failover policy
In the root domain DNS, add the AWS provided NS Records to delegate a subdomain. e.g.:
myapp NS ns-123.awsdns-09.net.
If you created Apex A Records/Alias in step 2, use myapp.xyz.com
If you created CNAMEs in step 2, use mycname.myapp.xyz.com; or shorten by adding a CNAME in the root domain to resolve to that address.
Hope this makes sense.
You need to point the name servers for your domain to AWS name servers.
Basically, below are the steps -
Login to the website from where you have bought the domain.
Go to the domain DNS settings for your domain on the website.
Name Server records NS records must be pointed to the website name servers, change them to the name servers you have from AWS route53.
Wait for at least 24 hours to reflect this change.