How can I point the root domain to Elastic Beanstalk? - amazon-web-services

I am trying to use the domain I just purchased in Route 53 to point to an application running in Elastic Beanstalk exy.elasticbeanstalk.com
If the domain I purchased is example.com and I want traffic to point to my application in Elastic Beanstalk, How can I achieve this?
So going to example.com launches the exy.elasticbeanstalk.com

In Route 53, alias records can be used at the root domain (also known as the zone apex) to refer to an Elastic Beanstalk Environment.
From Choosing Between Alias and Non-Alias Records:
Amazon Route 53 alias records provide a Route 53–specific extension to DNS functionality. Alias records let you route traffic to selected AWS resources, such as CloudFront distributions and Amazon S3 buckets. They also let you route traffic from one record in a hosted zone to another record. Unlike a CNAME record, you can create an alias record at the top node of a DNS namespace, also known as the zone apex. For example, if you register the DNS name example.com, the zone apex is example.com. You can't create a CNAME record for example.com, but you can create an alias record for example.com that routes traffic to www.example.com.
See https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html
For for more details regarding Alias records and Elastic Beanstalk see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html#rrsets-values-alias-alias-target

Related

How to route traffic from the Cloudflare root domain to an AWS elastic load balancer?

My Webservers are running on AWS.
I have created target groups and the load balancer.
I have the ALB domain but I want to customize that DNS to the Domain that is present in Cloudflare.
I wanna know how I can do that with the SSL certificates.
As I am not allowed to give CNAME records for the root domain. what are the other solution for this.
how can I route my traffic from the application load balancer to the domain present in Cloudflare?
CloudFlare has CNAME Flattening, which allows CNAME records on the root domain.
Here's my solution.
First we need to go to Route53 in aws console to create new hosted zone.
Then after we create the new hosted zone as per our given details, it will create an NS and SOA record in the R53.
WE need to add those NS records in our domain registrar. and then we need to create an Alias to our DNS which will Point to the ALB.
That's how we are able to create our customized domain name for the Application Load Balancer.
By Creating a hosted zone in R53 and adding the NS records to the domain registrar, we can delegate the DNS resolution of our custom domain to route53. Then by creating an alias to our ALB, we can map the custome domain to the ALB's DNS. This will allow us to access our ALB with our custom domain instead of using the ALB DNS.
IF THERE'S ANY OTHER SOLUTIONS THAN PLEASE FETCH YOUR ANSWERS.

AWS Route53 Error, trying to CNAME domain name to loadbalancer dns

Situation:
I have one loadbalancer which is serving a kubernetes cluster, and it has a dns name
I have my website domain, registered in route53 zone, and want to CNAME this to the dns of the loadbalancer
The initial records of the zone right after creation are:
Then I try to add the CNAME record of pointing mydomain.com to the loadbalancer DNS, and get the error shown in image:
My question is now:
How can I use mydomain.com to access the loadbalancer ? and still manage the dns records with route53 (i have other records for cdn etc in real domain aside root one that want to use for the loadbalancer serving the website)
I think that for this AWS specific solution, can use ALIASES instead of CNAME records to point the domain to a particular AWS Resource (loadbalancer in my case).
Aliases are DNS extensions for AWS system only
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html
Still this is very interesting question, and assuming no alias was possible, does it mean that you never can CNAME your bought root domain to some other domain ?

Create a subdomain that uses Amazon Route 53 as the DNS service without migrating the parent domain

I have a domain for instance example.com.
The domain is hosted by a third party service (Digital Ocean).
I would like to give control of a subdomain to AWS.
So I would like to point aws.example.com to AWS.
Once the root subdomain is pointed to AWS. I would like to use Route 53 to setup the following functionality:
aws.example.com => alias to eb my-production-eb
dev.aws.example.com => alias to eb my-dev-eb
stage.aws.example.com => alias to eb my-stage-eb
Is this possible? Do I have to point my domains directly via cname record to the AWS load balancer?
Update 1:
I feel like I need to set the following in Digital Ocean:
aws.example.com => revoke control to AWS Route 53 somehow
*.aws.example.com => revoke control to AWS Route 53 somehow
Update 2:
The AWS documentation for Creating a Subdomain That Uses Amazon Route 53 as the DNS Service without Migrating the Parent Domain does not work for Digital Ocean.
Do not add a start of authority (SOA) record to the zone file for the parent domain. Because the subdomain will use Amazon Route 53, the DNS service for the parent domain is not the authority for the subdomain.
If your DNS service automatically added an SOA record for the subdomain, delete the record for the subdomain. However, do not delete the SOA record for the parent domain.
The question on Digital ocean regarding changing the SOA address titled "How can I change the SOA address in DNS settings?" states the following in one of the comments.
Unfortunately it is not possible to edit the SOA address right now
There is the ability to vote for this feature in Digital Ocean Configurable SOA record in DNS.
So my idea is that because you can't remove the SOA on Digital Ocean Amazon can't communicate to the domain correctly.
You need to delegate the DNS subdomain aws.example.com to Route 53.
See Creating a Subdomain That Uses Amazon Route 53 as the DNS Service without Migrating the Parent Domain
You can create a subdomain that uses Amazon Route 53 as the DNS
service without migrating the parent domain from another DNS service.
The basic steps are:
Create an Amazon Route 53 hosted zone for the subdomain.
Add resource record sets for the new subdomain to your Amazon Route 53 hosted
Update the DNS service for the parent domain by adding name server records for the subdomain provided in Step 1.
Assuming the current TLD example.com is hosted at Digital Ocean, then you need to create NS resource records there for the aws subdomain, using the name servers Route 53 provides you when create the hosted zone for aws.example.com.
Then you can control all hosts *.aws.example.com, including CNAMES for ELBs etc. from Route 53.
Yes, you can have any number of subdomains whether they are A or CNAME records, just point them to the target (public) IP.

Domain name setup without A Records

I am hosting content on AWS and want to configure my DNS settings so that both my # record and www record point at my Elastic Load Balancer.
example.com (# record)
www.example.com (www record)
AWS recommends setting up domains using CNAMEs as the IP addresses can change.
All the documentation I have seen on the CNAME is that they deal with subdomains but not the primary domain itself (http://example.com
). The primary domain requires an A record and therefore must require an IP address.
I do not want to use an A Record to point the traffic to my Elastic Load Balancer as the IP address may change.
Any idea how I can get around this issue?
I am using Linode to manage my DNS.
You can use a special record type in Route 53 called "Alias".
Q. Can I point my zone apex (example.com versus www.example.com) at my
Elastic Load Balancer?
Yes. Amazon Route 53 offers a special type of record called an ‘Alias’
record that lets you map your zone apex (example.com) DNS name to your
ELB DNS name (i.e. elb1234.elb.amazonaws.com). IP addresses associated
with Amazon Elastic Load Balancers can change at any time due to
scaling up, scaling down, or software updates. Route 53 responds to
each request for an Alias record with one or more IP addresses for the
load balancer. Queries to Alias records that are mapped to ELB load
balancers are free. These queries are listed as
“Intra-AWS-DNS-Queries” on the Amazon Route 53 usage report.
Source: https://aws.amazon.com/route53/faqs/
Just set the Alias to Yes and you will be able to choose your load balancer from the dropdown menu:

How to configure, Route 53 and Elastic load balancer that access instances in two different regions in Amazon web services

I have two autoscaled instances in two different regions, and I configured Elastic Load Balancing for those two.
and finally I configured geo dns in Route 53, for two regions using CNAME alias.
Like below
(www.l.example.com. CNAME w.usa.example.com.)
(w.usa.example.com. A ALIAS xxxxxxxxx.us-west-2.elb.amazonaws.com)
(www.l.example.com. CNAME w.sg.asia.example.com)
(w.sg.asia.example.com. AALIAS yyyyyyyyyyyy.ap-southeast-1.elb.amazonaws.com)
how can I create record for example.com ???
Note :: if user open example.com in his browser from USA, it will route to US instance and from india, it will route to asia server.
I would change your CNAME record types to A and utilize Alias records. Then you can alias example.com -> www.l.example.com.
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-creating.html