

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Route 53 Hosted Zones
incomplete
2: A Records
incomplete
3: DNS TTL and Caching
incomplete
4: Verifying DNS
incomplete
5: CNAME Records
incomplete
6: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
What if you want blog.boot.dev to point to the same server as www.boot.dev? You could create another A record pointing to the same IP address, but there's a better way: CNAME records.
Click to play video
A CNAME record (Canonical Name) maps one domain name to another domain name. It's kind of like a DNS-level redirect (or more accurately, an alias).
When someone looks up cats.boot.dev, the CNAME says: "Check cat-server.boot.dev instead." That domain's A record then provides the IP address.
Sometimes it'll be a pretty simple path:
cats.boot.dev → cat-server.boot.dev → 1.2.3.4
CNAME A IP
Sometimes it can be a bit more complex:
cats.boot.dev → cats.east.boot.dev → cat.east.boot.dev → 1.2.3.4
CNAME CNAME → cat.east.boot.dev → 1.2.3.5
→ cat.east.boot.dev → 1.2.3.6
→ cat.east.boot.dev → 1.2.3.7
→ cat.east.boot.dev → 1.2.3.8
A records IP
A CNAME record has two main parts:
links)www.shortlinks.com)blog.boot.dev).Technically you can't have a CNAME for the root domain (boot.dev), but many DNS providers, including Route 53, let you do essentially the same thing through special handling (ANAME or Aliases). If you're curious, you can read more here.
PatientPing wants blog.patientping.internal to point at the same place as www.patientping.internal so they don't have to maintain two A records. Add a CNAME that aliases blog to www.
Create a CNAME record: blog.patientping.internal → www.patientping.internal.
ssh patientping
dig blog.patientping.internal
www.patientping.internal. 15 IN A 10.0.10.50
Run and submit the CLI tests from your own machine.
If you'd prefer to use the CLI:
aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch '{"Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"<record-name>","Type":"CNAME","TTL":300,"ResourceRecords":[{"Value":"<target-domain>"}]}}]}'