Sub topic 3
Routing Policies and Advanced Route 53 Operations
Assume you know IP addresses, VPCs, AWS resources, and basic command-line use. Route 53 routing policies decide which record value it returns for a DNS query.
Routing policies
| Policy | Typical use |
|---|---|
| Simple | One endpoint or a fixed set of values |
| Weighted | Gradual rollout or traffic splitting |
| Latency | Send users to the lowest-latency Region |
| Failover | Switch from a primary endpoint to a standby |
Weighted records use percentages. Latency records use AWS measurements. Failover records use health checks. Geolocation and geoproximity policies can route based on user location or resource location.
Private hosted zones
A private hosted zone contains names that resolve only inside associated VPCs. For example, db.internal.example.com can point to a private database address. Associate the zone with each VPC that needs it. For networks outside AWS, use Route 53 Resolver endpoints to connect DNS queries to on-premises DNS servers.
Automating record changes
The AWS CLI applies changes as an atomic change batch. UPSERT creates a record or replaces its current value.
{
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"TTL": 60,
"ResourceRecords": [{ "Value": "192.0.2.10" }]
}
}
]
}aws route53 change-resource-record-sets \
--hosted-zone-id ZONE_ID \
--change-batch file://change.jsonTesting and TTL awareness
Use dig to compare a recursive resolver with an authoritative server:
dig api.example.com A
dig NS example.com +short
dig @AUTHORITATIVE_SERVER api.example.com A +norecurseA record's time to live (TTL) controls how long resolvers may cache an answer. A changed record may therefore appear inconsistent until old cached answers expire. Query the authoritative server when checking whether Route 53 has the new value.
Resolver endpoints and DNSSEC
An inbound Resolver endpoint lets on-premises clients query names in a VPC. An outbound endpoint forwards selected VPC queries to on-premises DNS through forwarding rules.
DNSSEC signing adds digital signatures to DNS responses. A validating resolver checks the signature chain from the domain's trust anchor through the parent delegation to the hosted zone. This helps detect forged or altered DNS data.
Exercise
Which policy is usually suitable for sending 90% of traffic to one endpoint and 10% to another?
Show answer
A weighted routing policy with weights of 90 and 10.