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

Practical guide to mapping Beanstalk apps to domains using Route 53 alias records and CNAME entries in Amazon hosted zones.

So you built something on Elastic Beanstalk and now you want it to stop living at some sad myapp.elasticbeanstalk.com address. Welcome to DNS fun where patience meets propagation and everyone pretends caches are fast. This guide shows how to use Route 53 hosted zones with alias records and CNAME entries to give your Beanstalk app a real domain name. Yes it is boring, yes it works, and no you do not need to sacrifice a serverless goat to get it live.

Quick overview

High level steps you will take

  • Create or confirm an Elastic Beanstalk environment
  • Find the environment endpoint or the load balancer DNS name
  • Create or use an existing Route 53 hosted zone for your domain
  • Create an alias record for the root domain or a CNAME for a subdomain
  • Test and wait for DNS propagation while holding very still

Prerequisites

Before you begin verify these items

  • An Elastic Beanstalk environment running your app
  • Access to the AWS console or AWS CLI with Route 53 permissions
  • A registered domain name pointed to the Route 53 name servers for the hosted zone

Step 1 Create or identify the Elastic Beanstalk environment

Launch or pick the environment in the AWS console. Note the environment name and the platform. In the environment details you will see a domain such as myapp.elasticbeanstalk.com. Most environments sit behind a load balancer. That is what you will usually point DNS at, because it is the thing that actually receives traffic.

Step 2 Find the environment endpoint or load balancer target

Open the environment and copy either the environment endpoint or the load balancer DNS name from the environment details. The environment endpoint is handy for a quick CNAME. If you prefer to be explicit find the Application Load Balancer DNS name in the EC2 console under load balancers.

Step 3 Create or use an existing hosted zone in Route 53

In Route 53 create a hosted zone that matches your domain name if you do not already have one. Make sure the registrar for the domain points at the Route 53 name servers for that hosted zone. If the domain registrar is not pointing at the hosted zone then the records you add here will be ignored by the internet.

Step 4 Add an alias record or a CNAME

Rules to follow and why they exist

  • For the zone apex or naked domain like example.com you cannot use a CNAME record. Use a Route 53 alias A record that targets the load balancer or the Elastic Beanstalk environment if Route 53 offers it as an alias target.
  • For subdomains like www.example.com use a CNAME record that points to the environment endpoint or the load balancer DNS name. That is perfectly allowed and the usual choice for www.
  • Alias records are Route 53 special records that behave like A records while pointing at AWS resources. They are handy because they allow the root domain to resolve to dynamic AWS targets without breaking DNS rules.

Example using the console

  1. Open the hosted zone for your domain in Route 53
  2. Create a record set with name blank for the apex or name www for a subdomain
  3. If apex choose Record type A and set Alias yes then pick the load balancer or Beanstalk environment target
  4. If subdomain choose Record type CNAME and set the value to your environment endpoint such as myapp.elasticbeanstalk.com

Step 5 Test and wait for DNS propagation

DNS is patient. You are not. Use these commands to confirm what the world sees

dig +short example.com
dig +short www.example.com
nslookup example.com
nslookup www.example.com

Remember caches can take time to clear. If the records look right locally but not globally give it some minutes and try again. TTL settings control how long caches keep old answers.

Troubleshooting tips

  • If the apex shows a strange record check that your hosted zone name servers match what your registrar lists
  • If the alias target is missing in Route 53 check you selected the correct region and that the load balancer still exists
  • If CNAME is not resolving verify you pointed the CNAME to the exact environment endpoint without typos

Final thoughts

Mapping a domain to Elastic Beanstalk is not rocket science. It can feel dramatic though because DNS is slow and immortal. Use alias records for the root, use CNAME for subdomains, point to the load balancer when possible, and check with dig or nslookup when in doubt. Now go enjoy that shiny domain you earned with a few clicks and a little patience.

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.