Domain & CNAME
How to add new domain to AWS and assign the domain to load balancer and CNAME to give to the customer if they already have their own domain.
Add Domain to Route 53
Go to AWS console and select service Route 53
Select Hosted zones
Click Create hosted zone
Input Domain name as type Public hosted zone
Open Hosted zone details and copy Name servers to domain provider.
Assign Domain to Load Balancer
Go to AWS console and select service Route 53
Select Hosted zones and select domain you want to assign to load balancer.
On domain page, select Create record.
Select Simple routing for Routing policy. Then, click Next.
Click Define simple record.
Add data
Record name - sub domain name if any. (www also required to be define)
Record type - A
Value/Route traffic to - Select Alias to Application and Classic Load Balancer and select the load balancer you want the domain to assign to.
Evaluate target health - On
Click Define simple record.
After done with all the sub domains you want to be assigned. Click Create records.
CNAME
CNAME of load balancer should always be given to the customer that own his/her own domain.
Do not use IP from the instance as it will not go the load balancer. As well as the IP itself from the website which use the load balancer as the IP will change every time the user refresh.
Go to AWS console and select service EC2.
Select Load Balancing > Load Balancers.
Select load balancer you want to get the CNAME.
Description > Basic Configuration > DNS name.
Last updated