I want to create an Amazon Route 53 record for my domain and I need to choose a routing policy.
Resolution
Simple Routing
Use a simple routing policy for traffic that requires standard DNS records only and doesn't require special options such as weighted or latency routing. You can't use multiple records of the same name and type with simple routing. However, a single record can contain multiple values (such as IP addresses).
Use a simple routing policy to achieve any of the following.
- Create only one basic record of each name and type.
- Route traffic to a single resource (such as your website's web server).
- Route traffic to a single record with multiple values (such as an A record that specifies multiple IP addresses).
Note: Route 53 returns the values in a random order to the client, and you can't weight or determine the order with a simple routing policy.
In the following example, all the records for a domain are created in one resource record set.
| | | |
---|
Name | Type | Value | TTL |
www.example.com | A Record | 192.0.2.1 | 60 |
| | 198.51.100.1 | 60 |
| | 203.0.113.1 | 60 |
When a client makes a DNS request, Route 53 returns all three listed IP addresses.
Note: You can't attach a health check to a simple routing policy. Instead, Route 53 returns all values to the client no matter what the status of an IP address is. When an unhealthy IP address is returned, the user's client tries to connect to the unhealthy IP and the user experiences downtime.
Multivalue Answer Routing
Use a multivalue answer routing policy to achieve any of the following.
- Create more than one record of the same name and type.
- Distribute DNS responses across multiple resources.
- Return multiple values for a DNS query and route traffic to multiple IP addresses.
- Route traffic to multiple resources.
- Associate a Route 53 health check with your routing records.
When you make a DNS request with multivalue answer routing, Route 53 responds to DNS queries with up to eight health records. These health records are selected at random for the particular domain name. You can attach each record to a Route 53 health check. This makes sure that you don't receive a DNS response that is unreachable.
Multivalue answer routing distributes DNS responses across multiple IP addresses. If a web server becomes unavailable after a resolver caches a response, then you can try up to eight other IP addresses from the response. This might help you avoid downtime.
Note: Multivalue answer routing isn't a substitute for Elastic Load Balancing (ELB). Route 53 randomly selects any eight records. When you perform dig (on Linux) or nslookup (on Windows) on your domain name multiple times, you might notice that the IP addresses rotate. This rotation improves availability and provides some load balancing functionality. Your operating system performs this round-robin DNS for cached responses, not Route 53.
To enter more than one value in a multivalue answer record set, you must create a new resource record with the same name. Then enter each value separately. If you don't enter each value separately, then you receive the following error: "Getting error: The record set could not be saved because: - Each Multivalue answer record can have only one value. (Route 53 returns one answer from multiple records.)"
In the following example, there are multiple A Records, each with different values.
| | | | | |
---|
Name | Type | Value | TTL | Set ID | Health Check |
www.example.com | A Record | 192.0.2.2 | 60 | Web1 | A |
www.example.com | A Record | 198.51.100.2 | 60 | Web2 | B |
www.example.com | A Record | 203.0.113.2 | 60 | Web3 | C |
Note: If you create two or more multivalue answer routing records with the same name and type and then specify different values for TTL, then Route 53 changes the TTL value of all the records to the last specified value. Also, creation of multivalue answer alias records isn't supported.
Related information
change-resource-record-sets
Quotas on records