Introduction
The Domain Name System, or DNS, translates human-readable domain names like example.com into the IP addresses computers use to route traffic. In the cloud, DNS is far more than a simple lookup table; managed DNS services let you build intelligent routing policies that steer users to the best available endpoint based on their location, network latency, or business rules.
Cricket analogy: DNS is like a scorecard app translating a familiar team name like 'Mumbai Indians' into the specific stadium address where that match is actually being played, while cloud DNS services go further, routing a fan to the nearest broadcast feed based on their location.
Explanation
At its core, DNS still relies on basic record types: an A record maps a domain name to an IPv4 address, and a CNAME record maps one domain name to another. But cloud DNS services, such as Route 53-style offerings, layer routing policies on top of these records so the same domain name can resolve differently depending on who is asking and from where. Latency-based routing returns the IP address of the region that will give the requesting user the lowest network latency, useful for globally distributed applications. Geolocation routing returns different endpoints based on the geographic location of the requester, which is useful for compliance requirements or serving region-specific content. Weighted round robin routing splits traffic across multiple endpoints according to assigned weights, commonly used for gradually shifting traffic during a rollout, such as sending 10 percent of traffic to a new version and 90 percent to the stable version.
Cricket analogy: An A record maps 'Eden Gardens' to its street address, and a CNAME aliases 'Home of Kolkata cricket' to that entry; latency routing sends an Australian fan to the nearest broadcast server, geolocation routing serves regional commentary, and weighted routing shifts 10% of viewers to a new app version.
These policies also integrate with health checks: a DNS routing policy can be configured to stop returning the IP address of an unhealthy endpoint, automatically failing traffic over to a healthy region. This makes cloud DNS an active participant in high availability design, not just a passive lookup service.
Cricket analogy: It's like a broadcast network's routing desk that stops sending viewers to a commentary box whose feed just went dark and instantly switches them to the backup studio, so cloud DNS actively fails traffic over to a healthy region rather than passively listing an address.
Example
DNS record: api.example.com
Routing policy: Latency-based
us-east-1 endpoint: 203.0.113.10 (returned to users near US East)
eu-west-1 endpoint: 198.51.100.20 (returned to users near EU West)
Routing policy: Weighted (canary rollout)
v1 endpoint: 203.0.113.10 weight = 90
v2 endpoint: 203.0.113.11 weight = 10
-> ~10% of DNS responses point new clients to v2
Analysis
In the latency-based example, the same domain name api.example.com resolves to different IP addresses depending on where the request originates, so a user in Europe is automatically directed to the eu-west-1 endpoint rather than us-east-1, reducing round-trip time. In the weighted routing example, DNS itself becomes a traffic-shifting tool: by adjusting the weight values, you can gradually increase traffic to a new version without redeploying anything, and if health checks on v2 start failing, its weight can be reduced or its IP excluded automatically. This shows why cloud DNS is treated as a networking control plane, not just a name-to-address translator.
Cricket analogy: The same broadcast link auto.example.com sends a fan in London to the UK commentary server rather than the Mumbai one, cutting lag; meanwhile a streaming app can gradually shift 10% of viewers to a redesigned scorecard overlay without redeploying, and if the new version starts failing, its share drops or it's excluded automatically.
Key Takeaways
- DNS still relies on basic records like A and CNAME, but cloud DNS adds routing policies on top.
- Latency-based routing sends users to the region with the lowest network latency.
- Geolocation routing resolves domains differently based on requester location.
- Weighted round robin routing splits traffic by percentage, useful for gradual rollouts.
- Cloud DNS integrates with health checks to automatically route away from unhealthy endpoints.
Practice what you learned
1. What does latency-based DNS routing optimize for?
2. Which routing policy is most appropriate for gradually shifting traffic from an old version to a new version during a rollout?
3. How can cloud DNS services integrate with health checks?
4. What is the basic function of an A record in DNS?
Was this page helpful?
You May Also Like
Content Delivery Networks (CDNs)
Learn how CDNs cache content at distributed edge locations to cut latency, and how cache hits and misses work.
High-Availability Design
Design systems that stay up through redundancy and automatic failover, and understand what each additional 'nine' of uptime really costs.
Load Balancing in the Cloud
Learn how cloud load balancers distribute traffic across instances using Layer 4 and Layer 7 techniques and health checks.
Cloud Networking Basics
Learn the core building blocks that connect and isolate resources in the cloud: VPCs, subnets, route tables, and gateways.