| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
While ordinary Route 53 resource record sets are standard DNS resource record sets, alias resource record sets provide a Route 53–specific extension to DNS functionality. Instead of an IP address or a domain name, an alias resource record set contains a pointer to an Elastic Load Balancing load balancer, to an Amazon S3 bucket that is configured as a static website, or to another Route 53 resource record set in the same hosted zone. When Route 53 receives a DNS query that matches the name and type in an alias resource record set, Route 53 follows the pointer and responds with the applicable value:
An Elastic Load Balancing load balancer: Route 53 responds to each request with one IP address for the load balancer. If a load balancer has more than one IP address, Elastic Load Balancing selects one of the IP addresses at random and returns it to Route 53; Route 53 then responds to the request with that IP address.
An Amazon S3 bucket that is configured as a static website: Route 53 responds to each request with one IP address for the Amazon S3 bucket.
Another Route 53 resource record set in the same hosted zone: Route 53 responds as if the query had asked for the resource record set that is referenced by the pointer.
Alias resource record sets can save you time because Route 53 automatically recognizes changes in the resource record sets that the alias resource record set refers to. For example, suppose an alias resource record set for example.com points to an Elastic Load Balancing load balancer at lb1-1234.us-east-1.elb.amazonaws.com. If the IP address of the load balancer changes, Route 53 will automatically reflect those changes in DNS answers for example.com without any changes to the hosted zone that contains resource record sets for example.com.
Alias resource records sets are similar to CNAME records, but there are some important differences:
| CNAME Records | Alias Records |
|---|---|
Route 53 charges for CNAME queries. | Route 53 doesn't charge for alias queries to Elastic Load Balancing load balancers or Amazon S3 buckets. For more information, see Amazon Route 53 Pricing. |
You cannot create a CNAME record at the top node of a DNS namespace, also known as the zone apex. For example, if you register the DNS name example.com, the zone apex is example.com. | You can create an alias resource record set at the zone apex. |
A CNAME record redirects queries for a domain name regardless of record type. | Route 53 follows the pointer in an alias resource record set only when the record type also matches. |
A CNAME record can point to any DNS record hosted anywhere. | An alias resource record set can only point to an Elastic Load Balancing load balancer, to an Amazon S3 bucket that is configured as a static website, or to another resource record set in the same Route 53 hosted zone in which you're creating the alias resource record set. |
A CNAME record is visible in the answer section of a reply from a Route 53 DNS server. | An alias resource record set is only visible in the Route 53 console or the Route 53 API. |
A CNAME record is followed by a recursive resolver. | An alias resource record set is only followed inside Route 53. This means that both the alias resource record set and its target must exist in Route 53. |
Note
If an alias resource record set points to an Elastic Load Balancing load balancer or an Amazon S3 bucket, you cannot set the time to live (TTL); Route 53 honors the Elastic Load Balancing or Amazon S3 TTL. For more information about the current TTL value for Elastic Load Balancing, see the introduction to Using Domain Names With Elastic Load Balancing in the Elastic Load Balancing Developer Guide.
The following overview describes how you create alias or weighted alias resource record sets.
Create the AWS resources for your application:
Skip to Task 2.
Use Elastic Load Balancing to set up a load balancer. If you're creating weighted alias resource record sets, create one load balancer for each weighted alias resource record set. For more information, go to User Scenarios in the Elastic Load Balancing Developer Guide.
Note
Give the load balancer a name that will help you remember what it's for later. The name you specify when you create a load balancer is the name you'll choose when you create an alias or weighted alias resource record set in Route 53.
Use Amazon S3 to create a bucket that is configured as a website. For more information, go to Hosting Websites on Amazon S3 in the Amazon Simple Storage Service Developer Guide.
Important
You must give the bucket the same name as the domain name that users will use to access your application. For example, if you want users to the domain name example.com to access your application, you must name the bucket example.com.
If you're creating weighted alias resource record sets for a given domain name, you can only create one resource record set that routes queries to an Amazon S3 bucket because the name of the resource record set must match the name of the bucket, and bucket names must be globally unique.
Create a Route 53 hosted zone. For more information, see Creating a Domain that Uses Route 53 as the DNS Service.
Important
If you're creating an alias resource record set for an Amazon S3 bucket, you must either create the bucket and the hosted zone using the same account, or use the Route 53 API to create the alias resource record set.
For information about using the Route 53 API, see Making API Requests.
For information about calling the Route 53 API using the Route 53 dnscurl.pl utility, see
Example: Using dnscurl.pl.
Create alias resource record sets or weighted alias resource record sets in your hosted zone. For more information, see the applicable section:
API only: Check on the status of your changes. For more information, see Checking the Status of Your Change.