Routing traffic to an ELB load balancer - Amazon Route 53

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

To 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 using Route 53 as the DNS service provider for your domain, see Making Amazon Route 53 the DNS service for an existing domain.

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 Elastic Load Balancing 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.

  6. Specify the following values:

    Routing policy

    Choose the applicable routing policy. For more information, see Choosing a routing policy.

    Record name

    Enter the domain or subdomain 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, enter acme.

    Alias

    If you are using the Quick create record creation method, turn on Alias.

    Value/Route traffic to

    Choose Alias to Application and Classic Load Balancer or Alias to Network Load Balancer, then choose the Region that the endpoint is from.

    If you created the hosted zone and the ELB load balancer using the same AWS account, 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.

    Note

    The console prepends dualstack. to the DNS name of the application and Classic Load Balancer from the same AWS account only. When a client, such as a web browser, requests the IP address for your domain name (example.com) or subdomain name (www.example.com), the client can request an IPv4 address (an A record), an IPv6 address (an AAAA record), or both IPv4 and IPv6 addresses (in separate requests with IPv4 first). The dualstack. designation allows Route 53 to respond with the appropriate IP address for your load balancer based on which IP address format the client requested. You will need to prepend dualstack. for Application and Classic Load Balancer from the different account.

    Record type

    Choose A – IPv4 address.

    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 .

  7. Choose Create records.

    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.