Route 53, AWS Beanstalk, Domain Names, DNS, Alias Records a |Video upload date:  · Duration: PT1M0S  · Language: EN

Learn how to map domains to Elastic Beanstalk using Route 53 Alias records and CNAME entries in Amazon hosted zones

If your app is running on AWS Elastic Beanstalk and your domain still points at a sad old parked page you deserve better. This guide walks through mapping a domain in Route 53 to your Beanstalk environment using Alias records for the apex and CNAME entries for subdomains. No magic spells required just a few clicks and some mild impatience while DNS does its thing.

What you need before you start

Get these ducks in a row before you touch DNS

  • An AWS account with the Elastic Beanstalk environment up and healthy
  • A hosted zone for your domain in Route 53
  • The Beanstalk environment endpoint or the Application Load Balancer DNS name
  • Access to your domain registrar to confirm the name servers if needed

Quick steps to map the domain

Short version first for the impatient types

  1. Confirm the registrar points the domain to the Route 53 name servers
  2. Find the environment CNAME or the ALB DNS name in the Elastic Beanstalk console
  3. Create an Alias A record for the apex domain pointing to the load balancer when available
  4. Create a CNAME for the www subdomain pointing to the environment CNAME or CDN
  5. Lower TTL while testing then raise it later to reduce DNS lookups
  6. Verify with dig or nslookup and then load the app URL

Step one Verify hosted zone and name servers

Open the Route 53 hosted zone for your domain and copy the name servers listed there. Go to your registrar and make sure those name servers are set. If the registrar still points at another DNS provider the domain will behave like that provider owns it, which is not the mood you want.

Step two Find the Beanstalk endpoint or ALB DNS name

In the Elastic Beanstalk console note the environment CNAME such as myapp-env.elasticbeanstalk.com. If your environment uses an Application Load Balancer use the ALB DNS name as the Alias target. Route 53 can alias directly to AWS resources and that avoids extra DNS hops and surprises.

Step three Create the apex Alias record

Create an A record for the root domain with Alias enabled and point it at the load balancer. This gets around the classic restriction that you cannot create a CNAME at the apex. During setup use a modest TTL to speed testing and updates.

Step four Add a CNAME for www

Add a CNAME record for the www subdomain that targets the Beanstalk environment CNAME. If you put a CDN in front of your app then point both the apex Alias and the www entry at the CDN instead. That is the standard setup for most production architectures.

Step five Test and wait like a civilized person

DNS changes can be annoyingly patient. Use commands such as dig example.com +short and dig www.example.com +short or nslookup to confirm resolution. If things do not match your expected targets check TTL values and name server settings at the registrar. Small TTLs help during testing and then increase the TTL once everything is stable.

Troubleshooting tips

  • If the apex does not resolve check that you used Alias with an A record rather than a CNAME
  • If www goes to the wrong place confirm the CNAME targets the correct environment CNAME or CDN hostname
  • If propagation seems slow check previous TTLs and be patient because DNS is not in a hurry

Wrap up and final thoughts

Mapping Route 53 to Elastic Beanstalk is mostly administrative muscle memory. Use Alias records for the apex and CNAME for subdomains, point to the ALB when you have one, and verify with dig or nslookup. Lower TTL while testing and then raise it when you are confident. Now go sip something celebratory while the internet slowly agrees with you.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.