Routing policies are a Route 53 extension to DNS that allows you to customize query responses to affect how your content gets delivered. Routing policies shape the traffic based on our requirements in a number of different use cases. We can send all traffic to a single site, give multiple responses to a single request, enable load balancing, set percentages of where the user requests are sent, failover, and modify responses based on geographical locations.
When a record is created in Route 53, you must select a routing policy that will tell Route 53 what IP address to respond with when a query is made to that record, as shown in Figure 2.11. There are a number of policies that we will cover to better explain this concept. Policies include just a basic “what is the IP address of www.tipofthehat.com; here is its IP address” all the way to regional restrictions, network delays to determine proximity, and failover options.
Simple routing is the most basic of the Route 53 policies and is also its default for all new resources that you configure. It is a single record for a single resource. When a query is made, for example, for www.tipofthehat.com, a simple routing policy will return the A record’s single IP address, as shown in Figure 2.12. Simple routing is also used for other record types such as MX, TXT, and CNAMEs. If there are multiple records for a given domain name, simple routing will return only a single value that is chosen at random from multiple defined IP addresses.
FIGURE 2.9 Route 53 health check configuration
To review the process, a client types www.tipofthehat.com into her browser, and a DNS query is made from her local machine to its locally configured resolver. The resolver will ask the DNS infrastructure for the IP address of www.tipofthehat.com if it is not cached locally. The first query is made to the root DNS server for the .com top-level domain that gets returned; then the resolver will ask the top-level domain servers where it can find tipofthehat.com. Then the tipofthehat.com domain server will be queried for the IP address of www under that domain. A simple, single IP address is returned, and the browser now knows how to make a connection to the www.tipofthehat.com web server.
FIGURE 2.10 Route 53 health check notification
Multivalue responses are an extension to the simple routing policy. Instead of returning just a single IP address, multivalue will return any number up to eight responses of IP address for the same domain name and can be used as a form of host redundancy. This allows the client to choose which IP address to use as the domain is active on all of the IP addresses. Route 53 will also perform health checks on each endpoint and, if one should fail, remove that IP from its pool of responses. Multivalue responses are illustrated in Figure 2.13.