Interview Prep/Networking/DNS & Service Discovery

Why can't you put a CNAME at the zone apex, and what do you use instead?

BeginnerScenarioDNS & Service Discovery
Answer

Situation read → The apex (example.com) must hold SOA and NS records, and a CNAME cannot coexist with other records.

What I'd do →

  1. Use a Route 53 ALIAS record to the ALB or CloudFront distribution for example.com
  2. Other providers call it ANAME or CNAME flattening
  3. Or use A records pointing to static IPs
  4. Verify with dig example.com A +short and confirm it returns IPs

Why → ALIAS is resolved by the DNS provider at query time and returned as plain A records, so it is valid at the apex.

Interview tip → Add that Route 53 ALIAS queries to AWS resources are free.

All Networking questions Roadmap: Networking for DevOps

More on DNS & Service Discovery