Amazon Route 53
Tags: aws
Published: 2022-12-20 10:39:34

**Amazon Route 53** is a Domain Name System (DNS) web service. The task of a DNS is to translate domain names into IP addresses. An example for a domain name is www.google.com, an IP address could be e.g. **172.217.0.0**. When you open a new URL, like www.google.com, the browser first checks in the caches if the IP for this domain name is already present. If it can't find one, it will send a request to a DNS server to receive the IP address. With the IP address the browser is then able to connect to the destination server.

Route 53 is in authoritative DNS, meaning that you have control over which DNS record entries it has. Its also possible to add health checks so that as a result Route 53 returns the IP of the healthy resource. 

### Elements of a DNS record    
- domain name: e.g. google.com
- record type: A,AAAA, CNAME, ..[^1]
- value: e.g. 172.217.0.0
- routing policy 
- TTL: Time to Live, how long the DNS record is cached

### Hosted Zones
Hosted Zones are containers for records that define how to route traffic to a domain. Public hosted zones contain records for traffic on the internet. Private Hosted Zones contain records for one or more Virtual Private Networks (VPN).

### Time to Live (TTL)
When the client receives the IP address from Route 53, there will also be an information about the TTL contained. If the TTL is e.g. 24 hours, then the client will ask Route 53 for a new IP address of this destination when the time has passed. If you configure a low TTL this will cost more as there are more requests to Route 53 neccessary.

### Routing Policies
Routing policies define how Route 53 will respond to DNS queries.
#### Simple
The simple policy means, that Route 53 will send back one or more IP addresses for one domain name. The client can then choose one of these randomly. This policy can't be combined with health checks.
#### Weighted
With the weighted policy you control how many % of the requests should go to each destination server. You can assign a weight to each DNS record then, when these have the same name and type. You can also add health checks. A possible use case for this policy is to test a new app version with some of your customers.
#### Latency based
If you would like to redirect to the resource that has the least latency for the client that send the request, you can use the latency based policy. Again, you can add a health check.
#### Failover (active-passive)
With the failover policy you can define a primary resource with a health check and a different resource for failover. When the first resource is unhealthy, the traffic will be routed to the second resource.
#### Geolocation
The geolocation policy is based on the user-location. You can e.g. define that if the DNS request originates from France, you route them to a resource in Germany. You can define geolocations by continent, by country, or in the US by state.
#### Geoproximity
Geoproximity routing routes traffic to your resources based on the geolocation of the users and the resources. You can shift more traffic to a certain resource with a bias[^2].
#### Multi-Value
When configured for Multi-value Route 53 will return multiple IP-addresses for the same domain name which the client can choose from. It is possible to add health checks.

📚 Learn more: [AWS Route 53 documentation](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html)

[^1]: Full list with details about the types: [Record types](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html)
[^2]: Detailed explanation with visuals: [Geoproximity policy](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-geoproximity.html)