Amazon Route 53
Developer Guide (API Version 2012-12-12)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

How to Create Latency Resource Record Sets

You can create latency resource record sets using the Route 53 console or the Route 53 API. In the console procedures, we focus on the most common use cases, Elastic Load Balancing load balancers and Amazon EC2 instances that are associated with Elastic IP addresses. See the applicable topic:

Creating Latency Alias Resource Record Sets for Elastic Load Balancing Load Balancers Using the Route 53 Console

Note

You cannot configure an alias resource record set to evaluate the health of the alias target when the alias target is an Elastic Load Balancing load balancer.

To create latency alias resource record sets using the Route 53 console

  1. If you used the same AWS account to create your Route 53 hosted zone and to create the AWS resources for which you want to create latency alias resource record sets, skip to Step 2.

    If you created the hosted zone and the other AWS resources using different accounts, perform the following steps to get the DNS name for the load balancer:

    1. Sign in to the AWS Management Console using the AWS account that was used to create the other AWS resources.

    2. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

    3. For each Elastic Load Balancing load balancer for which you want to create a latency resource record set, get the DNS Name value for the A record. When you create the resource record set in Route 53 and specify the A record value, Route 53 responds to A and AAAA queries with the IPv4 or IPv6 address, as applicable.

      Important

      Do not use the value for the AAAA record or the dualstack (A or AAAA record) record.

    4. Sign out of the AWS Management Console. Then sign in again using the AWS account that was used to create the Route 53 hosted zone.

  2. Open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.

  3. In the Route 53 console, do one of the following to display the record sets for the hosted zone in which you want to create latency alias resource record sets:

    • Click the row for the hosted zone, and click Go to Record Sets.

    • Double-click the row for the hosted zone.

    Creating a resource record set: Go to Record Sets button on the Hosted Zones page.

  4. Click Create Record Set.

  5. In the right pane, enter the applicable values. For information about a field, see the tool tip for the field. Note the following:

    • For Type, select A — IPv4 address or AAAA — IPv6 address.

    • For Alias, click Yes.

    • For Alias Target, do one of the following:

      • If the load balancer and the hosted zone were created by the same AWS account, click the Alias Target field, and choose a load balancer from the list. If you have a lot of load balancers, you can type the first few characters of the DNS name to filter the list.

      • If the load balancer and the hosted zone were created using different AWS accounts, enter the value that you got in Step 1c for the DNS name of the load balancer.

      The value of Alias Hosted Zone ID appears automatically based on the value that you selected or entered for Alias Target.

    • For Routing Policy, select Latency.

      A value for Region is selected automatically based on the value you specified in the Alias Target field. We recommend that you not change this value.

    • For Set ID, enter a value that uniquely identifies this resource record set among the latency resource record sets with the same name and type.

    • Evaluate Target Health is unavailable because you cannot configure Route 53 to evaluate the health of the Amazon EC2 servers in an Elastic Load Balancing load balancer.

    • For Associate with Health Check, select Yes if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of a specified endpoint. Then select the health check that you want Route 53 to perform for this resource record set. For more information, see Managing Resource Availability with Route 53 DNS Failover.

    Creating a latency resource record set.

  6. Click Create Record Set.

  7. If you have load balancers in other Amazon EC2 regions, repeat Steps 4 through 6 to create latency alias resource record sets for the load balancers in each region.

Creating Latency Resource Record Sets for Elastic IP Addresses Using the Route 53 Console

To create latency resource record sets for Amazon EC2 instances that have Elastic IP addresses using the Route 53 console

  1. Get the Elastic IP address for each Amazon EC2 instance for which you want to create a latency resource record set:

    1. Sign in to the AWS Management Console using the AWS account that was used to create the Amazon EC2 instances.

    2. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

    3. In the Amazon EC2 console, get the Elastic IP addresses.

    4. If you created the Amazon EC2 instances and your Route 53 hosted zone using different AWS accounts, sign out of the AWS Management Console, and sign in to the AWS Management Console again using the AWS account that was used to create the Route 53 hosted zone.

  2. Open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.

  3. In the Route 53 console, do one of the following to display the record sets for the hosted zone in which you want to create latency resource record sets:

    • Click the row for the hosted zone, and click Go to Record Sets.

    • Double-click the row for the hosted zone.

    Creating a resource record set: Go to Record Sets button on the Hosted Zones page.

  4. Click Create Record Set.

  5. Enter the applicable values. For information about a field, see the tool tip for the field. Note the following:

    • For Type, select A — IPv4 address or AAAA — IPv6 address.

    • For Alias, click No.

    • For TTL, if you're associating this resource record set with a health check, we recommend that you specify a TTL of 60 seconds or less so clients respond quickly to changes in health status.

    • For Value, enter the IP address that you got in Step 1. You can enter more than one IP address.

    • For Routing Policy, click Latency.

    • For Region, Route 53 recommends an Amazon EC2 region based on the Elastic IP address that you entered in the Value field. We recommend that you not change this value.

    • For Set ID, enter a value that uniquely identifies this resource record set among the latency resource record sets with the same name and type.

    • For Associate with Health Check, select Yes if you want Route 53 to determine whether to respond to DNS queries using this resource record set by checking the health of a specified endpoint. Then select the health check that you want Route 53 to perform for this resource record set. For more information, see Managing Resource Availability with Route 53 DNS Failover.

    Creating a latency resource record set.

  6. Click Create Record Set.

  7. If you have Amazon EC2 instances in other Amazon EC2 regions, repeat Steps 4 through 6 to create a latency resource record set for the Amazon EC2 instance in each region.

Creating Latency Resource Record Sets Using the Route 53 API

To create latency resource record sets, use the ChangeResourceRecordSets action.

The following example creates two latency alias resource record sets, one for an Elastic Load Balancing load balancer in the US West (Oregon) region (us-west-2), and another for a load balancer in the Asia Pacific (Singapore) region (ap-southeast-1). In this example:

  • <hosted zone ID> is the ID of the Route 53 hosted zone in which you're creating the latency resource record set.

  • example.com. is the domain for which you are creating latency resource record sets.

  • <hosted zone ID for Oregon load balancer> and <hosted zone ID for Singapore load balancer> are the hosted zone IDs for the load balancers for example.com. You can get the hosted zone IDs—CanonicalHostedZoneNameID—for these load balancers in any of the following ways:

    • Use the DescribeLoadBalancers action. For more information, see "Actions" in the Elastic Load Balancing API Reference.

    • Use the Elastic Load Balancing elb-describe-lbs CLI command. For more information about this CLI command, see the Elastic Load Balancing Quick Reference Card or the Elastic Load Balancing CLI help.

    • Use the AWS Management Console. On the EC2 page, click Load Balancers in the Navigation pane.

  • example-load-balancer-1111111111.ap-southeast-1.elb.amazonaws.com and example-load-balancer-2222222222.us-west-2.elb.amazonaws.com are the domain names for your load balancers. Route 53 responds to queries for example.com with the IP address of one of these load balancers, depending on the latency between your end users and the Amazon EC2 regions in which you created your load balancers.

    You can get the domain name for a load balancer by using the same methods that you used to get the hosted zone ID for the load balancer.

  • <EvaluateTargetHealth>true</EvaluateTargetHealth> indicates that health checks are enabled for both latency alias resource record sets. For more information about health checks, see Managing Resource Availability with Route 53 DNS Failover.

POST /2012-12-12/hostedzone/<hosted zone ID>/rrset HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/
doc/2012-12-12/">
   <ChangeBatch>
      <Comment>
      This change batch creates two latency resource record sets, one 
      for the US West (Oregon) region and one for the Asia Pacific 
      (Singapore) region.
      
      </Comment>
      <Changes>
         <Change>
            <Action>CREATE</Action>
               <ResourceRecordSet>
                  <Name>example.com.</Name>
                  <Type>A</Type>
                  <SetIdentifier>Oregon load balancer 1</SetIdentifier>
                  <Region>us-west-2</Region>
                  <AliasTarget>
                     <HostedZoneId><hosted zone ID for 
                        Oregon load balancer></HostedZoneId>
                     <DNSName>example-load-balancer-2222222222.us-west-2.elb.amazonaws.com</DNSName>
                     <EvaluateTargetHealth>true</EvaluateTargetHealth>
                  </AliasTarget>
               </ResourceRecordSet>
         </Change>
         <Change>
            <Action>CREATE</Action>
               <ResourceRecordSet>
                  <Name>example.com.</Name>
                  <Type>A</Type>
                  <SetIdentifier>Singapore load balancer 1</SetIdentifier>
                  <Region>ap-southeast-1</Region>
                  <AliasTarget>
                     <HostedZoneId><hosted zone ID for 
                        Singapore load balancer></HostedZoneId>
                     <DNSName>example-load-balancer-1111111111.ap-southeast-1.elb.amazonaws.com</DNSName>
                     <EvaluateTargetHealth>true</EvaluateTargetHealth>
                  </AliasTarget>
               </ResourceRecordSet>
         </Change>
      </Changes>
   </ChangeBatch>
</ChangeResourceRecordSetsRequest>

For more information about changing resource record sets, see Creating, Changing, and Deleting Resource Record Sets. For information about listing resource record sets, see GET ListResourceRecordSets in the Amazon Route 53 API Reference.

After you send your change request, check to ensure that your change was applied to all Route 53 DNS servers by polling for the status of the change. For more information about polling for the status of a change request, see Checking the Status of Your Change.