DNS in Cloud Networking
Naming, resolution and routing policies in the cloud
Cloud DNS is the directory of your network: public domains, private zones for VPC-internal names, health-based routing, and CDN/LB integration. Getting resolution wrong is a silent application failure.
What you will learn
- Use managed DNS (Route 53 / Cloud DNS / Azure DNS)
- Design private hosted zones for internal services
- Chain DNS to load balancers and CDNs correctly
Managed cloud DNS holds your zones and answers queries. Public zones serve the internet; private hosted zones resolve names inside VPCs. Routing policies (weighted, latency, failover) steer traffic where you want.
What is this?
AWS Route 53, Azure DNS, and GCP Cloud DNS are managed authoritative DNS. Public zones: alias records to load balancers/CDN. Private hosted zones: scoped to a VPC (Route 53 private zones, Cloud DNS 'fully qualified' zones peering, Azure private DNS zones). Records: A/AAAA, CNAME, TXT, MX, SRV. Routing policies: weighted, latency-based, geolocation and health-check based failover. Resolution integrates with endpoints (private DNS for PrivateLink) so internal names map to private IPs.
Why do you need it?
- DNS is the user-visible contract; downtime or misresolution = user-visible failures.
- Private DNS is what makes internal service discovery (and endpoint names) work.
- Routing policies are free and instant — global failover at DNS level.
- Interviews love asking how DNS + LB + CDN compose.
Mental model
A city phone book redesigned per district
Public vs private DNS
One directory answers the public; each district gets its own private phone book for internal numbers. Routing policies are like operators who send you to the right branch based on your location.
How it works
- You create a hosted zone (public or private); NS records point domain delegations at it.
- Alias/A records resolve to LB/CDN endpoints; private zones resolve to private IPs within VPCs.
- Routing policies pick an answer set: weighted (A/B traffic), latency (nearest measured), failover (active/passive with health checks).
- Health checks run probes and flip DNS when a target fails.
- DNSSEC and TLSA strengthen trust where required.
DNS layers in a cloud app.
In production
- A global SaaS uses a latency-based Route 53 record that points app.example.com to the nearest region's ALB.
- A VPC-internal microservice addresses other services via private hosted zones with stable service names.
- An enterprise uses Azure Private DNS zones so private endpoints resolve to private IPs automatically.
Best practices
- Prefer Alias/CNAME to LB/CDN so DNS changes stay in one place.
- Use health checks on routing records; never point at a dead target.
- Version TTL: short for traffic-shaping records, longer for static.
- Keep private-zone authorities per-VPC and document which VPCs may resolve it.
Common mistakes
- Hardcoding IPs in app config instead of DNS names.
- Local DNS caches outliving TTL — degradation after failover looks like 'it's still broken'.
- Public and private zone name collisions resolving confusingly.
- Forgetting DNSSEC when a partner requires it.
Common issues
App can't resolve an internal servicePrivate zone not associated with the app's VPC
Associate the private zone with the VPC and verify resolution from within.
Failover not working during LB degradationHealth check passes 200 but app is failing, or TTL caching
Make the check app-meaningful (e.g. /healthz with app state) and lower TTLs for critical records.
Debugging tips
- dig +norecurse against the zone's NS to see the authoritative answer.
- Check TTL before claiming 'DNS hasn't propagated'.
- Private zones: verify the VPC is associated with, and resolver is in, the right scope.
- Health-check flapping? Look at the probe source IPs and your WAF/LB allowlists.
Interview checkpoint
Hands-on lab
- Create records in a private hosted zone (simulated)
- Point internal services at arbitrary names
- Verify resolution through DNS tooling
Using a Private Hosted Zone Locally
25 min · intermediate
Quick quiz
What routing policy sends users to the region with the best measured latency?