A — Address (IPv4)
- What: Maps a hostname to an IPv4 address.
- Typical cloud use: Pointing api.example.com to an EC2 instance or a VM IP in GCP/Azure for simple services or legacy systems.
- When: Use for single-instance endpoints or small clusters behind a static public IP.
AAAA — Address (IPv6)
- What: Maps a hostname to an IPv6 address.
- Typical cloud use: Same as A but for IPv6-enabled services (dual-stack load balancers, CDN origins that support IPv6).
- When: Use when you need IPv6 reachability or compliance with modern networking requirements.
CNAME — Canonical name (alias for a hostname)
- What: Points one hostname to another hostname.
- Typical cloud use: www.example.com → app.example.com or service.example.com → nginx.prod.internal.
- When: Use for subdomain indirection, per-environment hostnames, or when the final endpoint is a managed DNS name. Cannot be used at the zone apex.
ALIAS / ANAME — Zone-apex alias to another DNS name or cloud resource
- What: Provider-specific record that behaves like CNAME at the zone root (example.com) and resolves to A/AAAA.
- Typical cloud use: example.com → AWS ELB (Route 53 ALIAS), GCP Cloud Load Balancer (Cloud DNS ALIAS), Azure Traffic Manager.
- When: Use when you need to point the apex to a cloud-managed load balancer, CDN, or other dynamic target.
TXT — Text (arbitrary text)
- What: Stores text data.
- Typical cloud use: SPF/DKIM/DMARC records for email, domain ownership verification (e.g., Google Search Console), or small configuration strings for services.
- When: Use for verification and policy records; not for routing.
DNS-based load balancing & health checks
- DNS LB: Use weighted, latency-based, or geolocation policies (Route 53, GCP Cloud DNS policies, Azure Traffic Manager) to steer traffic across regions or endpoints. Good for global failover, blue/green traffic splits, or directing users to nearest region.
- Health checks: Configure DNS provider health checks to automatically remove unhealthy endpoints from DNS responses (failover and improved availability). Combine with low TTLs for faster convergence.
- When to choose DNS LB vs. network LB: Use DNS LB for global traffic steering and cost-effective geo-routing; use cloud-native LBs (ALBs/GLBs) when you need per-connection balancing, sticky sessions, or advanced L4/L7 features.
Practical notes
- Keep TTLs low for failover scenarios, higher for stable static targets.
- Prefer ALIAS/ANAME at apex to avoid CNAME restrictions.
- Use TXT carefully — public visibility and size limits.