7.80 The CNAME and Alias records

When you provision AWS resources such as Application Load Balancers, CloudFront distributions or Elastic Beanstalk, AWS gives them an auto-generated DNS name like my-lb-123456.eu-west-1.elb.amazonaws.com. To expose them as a user-friendly URL like app.mon-domaine.com, you have two options: a CNAME record or an Alias record. Both achieve the same outcome but with very different rules.

A CNAME (Canonical Name) record points a hostname to another hostname. For example app.mon-domaine.com can be a CNAME pointing to the load balancer's AWS hostname. The catch: a CNAME cannot be used at the root domain. You cannot CNAME mon-domaine.com itself — only subdomains. An Alias record solves that: it lets you point any record, root domain included, to an AWS resource (ELB, CloudFront, S3 bucket, etc.). Aliases are free, support health checks, and work at the apex of the domain.

Key differences

  • Root domain: CNAME forbidden — Alias allowed.
  • Cost: CNAME queries are billed — Alias queries are free when pointing to AWS resources.
  • Health checks: Alias supports them — plain CNAME does not.
  • Target: CNAME points to any hostname — Alias points to AWS resources only.

In the console you create a record, pick the routing policy (simple), choose between IP/hostname or Alias, and supply the value. With CNAME you paste the load balancer URL. With Alias you select the resource type (for example Application/Classic Load Balancer), pick the Region and choose the resource from the dropdown. Both records make the friendly URL serve the load balancer. The Alias just adds health-check support and is free for AWS targets — that is why Aliases are almost always the right choice when the backend is an AWS resource in the same account.

Summary

This lesson explores the critical differences between CNAME records and Alias records in AWS Route 53. CNAME records can redirect queries from one domain to another but are restricted to non-root domains and require paid DNS queries. AWS Alias records, by contrast, work for both root and non-root domains, are provided free by Amazon, and support health checks—making them the preferred choice when routing to AWS resources.

Key points

  • CNAME records point any domain to another domain but cannot be used on root domains (e.g., example.com), only subdomains (e.g., app.example.com)
  • Alias records are AWS-native and work for both root domains and subdomains, enabling free redirection to AWS resources without DNS query costs
  • Alias records support health checks to evaluate target health, a capability unavailable with standard CNAME records
  • CNAME records incur charges for each DNS query, whereas Alias records to AWS resources are provided at no cost
  • Both record types achieve the same functional outcome—directing user requests to the intended resource—but differ significantly in scope and cost when using AWS infrastructure

FAQ

Can I use a CNAME record for a root domain like example.com?

No, CNAME records cannot be used for root domains. They work only for subdomains. For root domains, you must use an Alias record (AWS-specific) or an A record with a static IP address.

What is the main cost advantage of Alias records over CNAME records?

Alias records to AWS resources are provided free by Amazon Web Services, while CNAME records incur a charge for each DNS query performed. This makes Aliases more economical for applications using AWS services.

What is the health check feature in Alias records and why does it matter?

Alias records allow you to enable health checks on the target resource. This feature is unavailable with CNAME records and enables AWS Route 53 to verify that the target (e.g., a load balancer) is healthy before directing traffic to it.