How do I create alias records for services hosted in AWS?

4 minute read

I want to create custom DNS records for AWS-hosted services, and I want to know what type of alias record to use.

Short description

Amazon Route 53 alias records map internally to the DNS name of alias targets, such as AWS resources. Route 53 monitors the IP address associated with an alias target's DNS name for scaling actions and software updates. Route 53 name servers respond with an A record (IPv4 addresses) or AAAA record (IPv6 addresses) with the IP address of the alias target.


Create an alias record

Create your record in the Route 53 console and specify the necessary values for alias records.

Be sure to use the correct DNS record type for IP addresses in the service you're pointing to:

  • Amazon CloudFront distribution: A record (IPv4) or AAAA record (IPv6)
  • AWS Elastic Beanstalk environment: A record (IPv4)
  • Elastic Load Balancing load balancer: A record (IPv4) or AAAA record (IPv6)
  • Amazon Simple Storage Service (Amazon S3) bucket: A record (IPv4)
  • Amazon API Gateway custom Regional API and edge-optimized API: A record (IPv4)
  • Amazon VPC interface endpoint: A record (IPv4)
  • AWS Global Accelerator: A record (IPv4)
  • AWS AppSync: A record (IPv4)
  • AWS App Runner: A record (IPv4)
  • Another Route 53 record in the same hosted zone

Note: Some services require you to set up a custom DNS name before creating the record. These services include Amazon API Gateway and Amazon CloudFront.

CNAME support

Route 53 follows the pointer in an alias record only if the record type matches. To create an alias record for a CNAME record, the alias target must resolve to a CNAME value.

Even if you create a CNAME(ALIAS) record that's not valid, Route 53 can't resolve the IP address of the endpoint. As a result, Route 53 returns an SERVFAIL/REFUSED RCODE error.

Valid CNAME(ALIAS) record


Not valid CNAME(ALIAS) record


Point from non-Route 53 DNS providers

If you use a DNS provider other than Route 53 for your domain, then you might be able to point the domain to AWS services. Check if your DNS provider supports CNAME records on a root domain. To do this, use techniques such as CNAME flattening, ANAME records, or WebHops Redirect.

Considerations for creating CNAME records

  1. You can't create a CNAME record for the Parent, Naked, or Apex domain. With Route 53, you can use an alias record to point the parent domain to other supported alias targets. For example, if you create a hosted zone for the domain, then you can't create the following CNAME record: CNAME

    If you create a hosted zone for the domain, then you can't create the following CNAME record: CNAME

    With Route 53, you can create an alias record instead: Alias(A)
  2. CNAME records can't coexist with other record types for the same domain in the hosted zone file. For example, you can have only one record type for the domain if the record type is CNAME. You can't create the following record: CNAME A
  3. You can create a wildcard record that can coexist with the CNAME record: CNAME*   A

Related information

Why can't I select my preferred alias target when creating a Route 53 alias resource record set?

AWS OFFICIALUpdated 7 months ago