Lesson 10 of 30
DNS is the layer everyone assumes 'just works' until a domain switch goes wrong — and the fix is never mysterious, it's always one of a handful of specific, well-understood mechanisms.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
A team wants `example.com` (the bare apex, no `www.`) to point at a CloudFront distribution. Why can't they just use a plain CNAME record?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Route 53 is AWS's DNS service: it answers "what does this domain name actually point to?" A few record types cover almost everything a frontend developer runs into:
example.com with no subdomain), because the apex also has to hold other required records (like MX for mail) that can't coexist with a CNAME there.On top of records, routing policies decide which answer to hand back when there's more than one candidate: simple (one static answer, no logic), weighted (split traffic across multiple answers by assigned proportion), latency-based (send each resolver toward whichever region is fastest for it), and failover (serve a primary answer, switch to a secondary the moment a health check reports the primary unhealthy).
example.com — the apex, no www. — needs to point at a CloudFront distribution. A plain CNAME record can't do this; the DNS spec doesn't allow one at the apex. Route 53 solves it with an ALIAS record: example.com gets an ALIAS record pointing at the CloudFront distribution's domain name, which resolves correctly at the apex and, unlike a CNAME, doesn't add an extra hop at query time. www.example.com gets its own ALIAS (or CNAME) pointing at the same distribution, so both the bare domain and the www version work.
"How would you point a bare domain at a CloudFront distribution, when CNAME records can't be used at the zone apex?" is a real, specific question, and naming ALIAS by name — not just "some kind of DNS trick" — is what separates someone who's actually configured DNS on AWS from someone who's only used it as a black box.