Menu
Amazon Route 53
Developer Guide (API Version 2013-04-01)

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 record that points to your load balancer. An alias record is a Route 53 extension to DNS. It's similar to a CNAME record, but you can create an alias record both for the root domain, such as example.com, and for subdomains, such as www.example.com. (You can create CNAME records only for subdomains.)

Note

Route 53 doesn't charge for alias queries to ELB load balancers or other AWS resources.

Prerequisites

Before you get started, you need the following:

  • An ELB load balancer. You can use an ELB Classic, Application, or Network Load Balancer. For information about creating a load balancer, see Getting Started with Elastic Load Balancing in the Elastic Load Balancing User Guide.

    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 record in the Route 53 console.

  • A registered domain name. You can use Route 53 as your domain registrar, or you can use a different registrar.

  • Route 53 as the DNS service for the domain. If you register your domain name by using Route 53, we automatically configure Route 53 as the DNS service for the domain.

    For information about migrating DNS service to Route 53, see Migrating DNS Service for an Existing Domain to Amazon Route 53.

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

  1. If you created the Route 53 hosted zone and ELB load balancer using the same account, skip to step 2.

    If you created the hosted zone and the ELB load balancer using different accounts, perform the procedure Getting the DNS Name for an ELB Load Balancer to get the DNS name for the load balancer.

  2. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

  3. In the navigation pane, choose Hosted Zones.

  4. Choose the name of the hosted zone that has the domain name that you want to use to route traffic to your load balancer.

  5. Choose Create Record Set.

  6. Specify the following values:

    Name

    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.

    Type

    Choose A – IPv4 address.

    Alias

    Choose Yes.

    Alias Target

    If you created the hosted zone and the ELB load balancer using the same AWS account – Find the applicable category in the list (ELB Application Load Balancers, ELB Classic Load Balancers, or ELB Network Load Balancers), and then choose the name that you assigned to the load balancer when you created it.

    If you created the hosted zone and the ELB load balancer using different accounts – Enter the value that you got in step 1 of this procedure.

    Routing Policy

    Accept the default value of Simple.

    Evaluate Target Health

    If you want Route 53 to route traffic based on the health of your resources, choose Yes. For more information about checking the health of your resources, see Creating Amazon Route 53 Health Checks and Configuring DNS Failover.

  7. Choose Create.

    Changes generally propagate to all Route 53 servers within 60 seconds. When propagation is done, you'll be able to route traffic to your load balancer by using the name of the alias record that you created in this procedure.