Aws Route 53 - How to keep sub-domains in multiple aws accounts? - amazon-web-services

We purchased a domain "company.com" through GoDaddy(managed by my company) and configured the DNS for same domain in my aws account aws-dev.
I created a sub-domain in aws-dev, "sales.dev.company.com" using a public hosted zone and configured required Route 53 entries.
I am to able to access this sub-domain successfully.
Now we have got another aws account aws-test, and we want to transfer the DNS (for company.com) to this account
but want to keep sub-domain/hosted zone for sales.dev.company.com in aws-dev only as services are running in this account.
Is there a way i can transfer the dns for company.com to aws-test and whenever
a request comes in for sales.dev.company.com, it gets routed to another aws account aws-dev in this case which hosts mapped service and otherwise all requests for company.com will be serviced from aws-test account ? If yes how this can be achieved ?

After searching around this solution worked for me:
Created hosted zone company.com in aws-test
Updated GoDaddy to replace DNS servers to new dns servers from step-1
Deleted company.com hosted zone from aws-dev.
Create sales.dev.company.com hosted zone in aws-dev.
Update ns records from step-4 in company.com in aws-test.
In simple terms this is what happens - whenever a request is being made to sales.dev.company.com, it first go to GoDaddy which forward it to aws-test which own company.com and now because aws-test knows where sales.dev.company.com lives, it gets forwarded to aws-dev.

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.

Route 53 for hosting different environments on multiple AWS accounts

I'm having real difficulty in getting the environments setup on 2 AWS accounts which are related to each other by the virtue of Organisation Hierarchy. My root DNS provider is GoDaddy which is hosting DNS record for example.com. We have multiple services which needs to be hosted on subdomain services.example.com. My setup is like:
GoDaddy -> Root DNS provider for example.com. Has NS record entries for services.example.com pointing to AWS Prod Account's Hosted Zone
AWS Prod Account -> Has Hosted Zone as services.example.com. Within this hosted zone I have A Records for production services service1.services.example.com, service2.services.example.com, etc.
AWS Dev Account -> Need a way to host environments such as test, uat, release on Prod account subodmain as:
Service 1:
test.service1.services.example.com
uat.service1.services.example.com
release.service1.services.example.com
Service 2:
test.service2.services.example.com
uat.service2.services.example.com
release.service2.services.example.com
Is there any way that I can achieve this. I have attached an image for visually simplifying this setup.
Create a hosted zone for service1.services.example.com in Acc 2.
Note the 4 name servers that Route 53 assigns to it the new hosted zone.
Back in the services.example.com (master zone) on Acc 1, create a new resource record, with hostname service1 using record type NS, and enter the 4 name servers that Route 53 assigned, in the box below.
You just delegated the service1.services.example.com subdomain, and any hosts and subdomains in it, to a different hosted zone, which you can now break to your heart's content, without impacting the the other records.
And just can just repeat the same process for all other services you want to delegate as well. You will end up with a new hosted zone for each service, but that is a totally fine way of doing so.
The hosted zone for the subdomain can be in the same account or a different account.

Where to find domain name to existing EC2 instance

I'm new AWS and I have to continue maintaining previous developer service that is hosted on AWS. The ec2 instance that is hosted has map to domain name of https://****c.k**g.g***an.org.au, however I couldn't find this domain name anywhere. I tried looking at route53, but there's no such domain name registered.
Please help, how do I find the domain name that is mapped to the EC2 instance? Where can I get that information. The reason because I want to deploy a new instance but with the same domain name.
Edit: Masking DNS for privacy reasons.
Are you sure your DNS is hosted by Route53? Running dig against k***.g****.org.au has the SOA held by ns1.mooball.net.
The whois for mooball.net returns register.com as the owner, so I would consider reaching out to your internal teams to see who holds that account, then check your DNS delegation settings by logging in to register.com.
Often times the client will control their own DNS, so it would also be worth confirming with your client where their root DNS (garvan.org.au) is hosted - you can then trace the subdomain delegation to see where it is ultimately hosted.
check route53 service in AWS , since the domain is served by https..it could be the domain mapped to a load balancer and the load balancer has the instance...anyway you can know from the route53 there you find all the records

AWS S3 and route 53 not propagating

I purchased a domain on uniregistry (ka.beer) and I want to set it up to use S3 for hosting and using route 53 for the DNS.
Steps I have taken so far:
Create hosted zone on route 53 with the name of the root domain (ka.beer)
Taken the NS records generated from this zone and updated the NS records of the domain on uniregistry, verified that this is propagated correctly using whatismydns.net
Created 2 buckets with names ka.beer and www.ka.beer in S3
Set up the root bucket to be public using the bucket policy and uploaded a test index page
Set up both buckets for static web hosting, with the www bucket to redirect to the main domain
Created A records in route 53 for ka.beer and www.ka.beer as aliases with the alias target to be the S3 zone (s3-website.eu-west-2.amazonaws.com.)
Now what I want is when I visit www.ka.beer, for it to redirect to ka.beer and when I visit ka.beer for it to show the website uploaded to that S3 bucket and to keep the same domain name
What happens currently: www.ka.beer does not resolve and ka.beer redirects to ka.beer.s3-website.eu-west-2.amazonaws.com
Thanks
Very frustrating issue but it turns out that the nameserver records were cached on my router. Clearing local cache and using incognito did not solve the problem, I had to log in to my router and reset the cache on there and then it started resolving correctly.
It looks you were doing the AWS Example: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
If that's the case, check your Route53 entries. The domain name should match the S3 bucket name.
ka.beer A http://ka.beer.s3-website-us-west-2.amazonaws.com
www.ka.beer A http://www.ka.beer.s3-website-us-west-2.amazonaws.com
have a look on below steps.
Login into aws console
I am assuming you have set your project on your public ip of EC2.
Go to the Route 53
Under DNS management: Click on Hosted zone
Create the new Hosted zone with specific domain(your domain)
After successful creation of hosted zone you will see NS and SOA entries with your domain name
Copy all the nameserver from here and update it under your domain DNS setting (Domain provider eg godaddy etc).
Note: Domain setting : You can visit here under your domain provider
After updating nameserver in your domain provider. It can take time for updation.
After that create A record under hosted zone under Route53 and assign the bucket or EC2 instance.
After some time your domain with point to that instance

How to move a domain from Godaddy to AWS Route 53

Since Godaddy went down for some hours my client and I are very upset and want to change everything to AWS.
Everything is done so far, only the domains (blablabla.com) are missing, I'm having a hard time trying to migrate from godaddy to Route 53, Do I have to remove from one and create from scratch from AWS?
Does anyone have any experience on how to do this?
the solution:
Login on your aws console;
Click on Route 53;
Create Hosted Zone;
Select your new created host title and click "Go to Record Sets", take note of the nameservers;
Login on your Godaddy account;
Select your domain;
Go to Nameservers and click SetNameservers;
paste all the four you took from "Go to Record Sets" Route 53;
and that's it..., you don't have to rely on this horrible service Godaddy provides anymore
You can transfer the domain registration to AWS Route 53.
You have to "unlock" the account.
Log On to Go Daddy.
Go to Domain Details Then Settings:
Lock: Set to Off
Authorization Code: Email My Code
Route 53 will need the authorization code to complete the transfer request.
Here are the steps to migrate your internet domain name to AWS route 53 (DNS Manager).
** Be careful where your mail server is hosted, either in the Godaddy mail service, Gmail (gsuite) or in your Cpanel server (VPS/Server).
** To empower your Domain DNS capabilities, you need to transfer the name servers, DNS records and domain name to AWS route53, thats why it's recommended to move to AWS Route 53. You can keep Godaddy to be owner of your yourdomain.com and manage your DNS by Route 53
STEPS:
Go to Godaddy DNS records and understand each of them and note them (Take a screenshot)
Go to AWS route 53, Crete a Public hosted Zone (Create your domain on AWS route 53). Here is a good tutorial about it:
https://www.clickittech.com/aws/migrate-godaddy-to-aws-route53/
Copy your Godaddy DNs records into your Public hosted zone previously created. Remember, each record needs to exist in the new aws zone.
Change your Name Servers to AWS Route 53. What does it means? In order to allow AWS route 53 to manage your domain, DNs records, etc. you need to change your actual Godadaddy Name server (NS) Records to AWS Records.
Go to Godaddy admin Panel and Login
Go to DNS Management
Under Name Servers Click on Change - > Custom - > Change Name Servers
You need to change from NSx.domaincontrol.com to the AWS Name servers.
More info: https://www.clickittech.com/aws/migrate-godaddy-to-aws-route53/
After 4-8 hours your Name Servers will be reflected and propagated around your country, world and networks.
Practically you are done with this.
Additionally, if you need to migrate your website or web app to AWS go to this tutorial, great explanation, see below:
https://www.clickittech.com/aws-migration/transfer-domain-aws-migrate-move-website-aws/
The answer from The Poet above is good for moving everything, but it will also kill your email service with GoDaddy. If you want to keep the email servers running at GoDaddy, you will also need to get your MX email servers and their priority numbers. Mine looked like this...
0 smtp.secureserver.net
10 mailstore1.secureserver.net
Take these over to your Route53 settings, click Create Record Set, choose a type of MX Mail Exchange, and paste these values in (with the number in the front as shown above). Save the record set.
Also PJT was correct; all domain info in Route53 ends with an extra period for some reason specific to AWS, but don't worry about it--it doesn't affect production behavior. When you copy your four from Route53 to paste in GoDaddy's Name Servers, you will need to do them one at a time and trim off the extra period at the end.
If you want to migrate your DNS records to Route 53, you'll need to export them from GoDaddy and recreate them manually in Route 53.
To do this in one automated step, consider a DNS migration tool such as DNSTools.ninja, as outlined here: https://dnstools.ninja/migrate-bind-aws-route53-safely-3-commands/
Be careful with google mx records if you have them.
Why switch to route 53?
AWS Route 53 doesn’t limit you to 64 subdomain.
AWS allows you to host buckets with route 53
It all comes at a 50 cent/month.
AWS Nameservers
Now to answer your question, you need move the name servers to route 53. That means in godaddy name server section should be filled with aws name servers.
See the steps here.
https://metamug.com/article/dns-migrate-godaddy-to-route-53.php
The detailed steps to transfer the domain registrar from GoDaddy to Route 53 is given at https://cloudopian.com/blog/how-to-transfer-domain-registrar-from-godaddy-to-amazon-route-53/
Remember, you first need to transfer your name servers by creating a hosted zone in Route 53 and pointing your godaddy hosted domain to use Route 53's name servers instead of it's own name servers.