Routing Traffic to an ELB Load Balancer
If you host a website on multiple Amazon EC2 instances, you can distribute traffic to your website across the instances by using an Elastic Load Balancing (ELB) load balancer. The ELB service automatically scales the load balancer as traffic to your website changes over time. The load balancer also can monitor the health of its registered instances and route domain traffic only to healthy instances.
To route domain traffic to an ELB load balancer, use Amazon Route 53 to create an alias resource record set that points to your load balancer. An alias resource record set is an Amazon Route 53 extension to DNS. It's similar to a CNAME resource record set, but you can create an alias resource record set both for the root domain, such as example.com, and for subdomains, such as www.example.com. (You can create CNAME resource record sets only for subdomains.)
Amazon Route 53 doesn't charge for alias queries to ELB load balancers or other AWS resources.
Before you get started, you need the following:
An ELB load balancer. You can use either an ELB Classic or Application Load Balancer. For information about creating a load balancer, see the following documentation:
Give the load balancer a name that will help you remember what it's for later. The name that you specify when you create a load balancer is the name that you'll choose when you create an alias resource record set in the Amazon Route 53 console.
A registered domain name. You can use Amazon Route 53 as your domain registrar, or you can use a different registrar.
Amazon Route 53 as the DNS service for the domain. If you register your domain name by using Amazon Route 53, we automatically configure Amazon Route 53 as the DNS service for the domain.
For information about migrating DNS service to Amazon Route 53, see Configuring Amazon Route 53 as Your DNS Service.
Configuring Amazon Route 53 to Route Traffic to an ELB Load Balancer
To configure Amazon Route 53 to route traffic to an ELB load balancer, perform the following procedure.
To route traffic to an ELB load balancer
Sign in to the AWS Management Console and open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.
In the navigation pane, choose Hosted Zones.
Choose the name of the hosted zone that has the domain name that you want to use to route traffic to your load balancer.
Choose Create Record Set.
Specify the following values:
Type the domain name that you want to use to route traffic to your ELB load balancer. The default value is the name of the hosted zone.
For example, if the name of the hosted zone is example.com and you want to use acme.example.com to route traffic to your load balancer, type acme.
Choose A – IPv4 address.
- Alias Target
Find the applicable category in the list (ELB Application Load Balancers or ELB Classic Load Balancers), and then choose the name that you assigned to the load balancer when you created it.
- Routing Policy
Accept the default value of Simple.
- Evaluate Target Health
Accept the default value of No.
Changes generally propagate to all Amazon Route 53 servers in a couple of minutes. In rare circumstances, propagation can take up to 30 minutes. When propagation is done, you'll be able to route traffic to your load balancer by using the name of the alias resource record set that you created in this procedure.