Back to Blog

What is a CNAME Record? DNS Aliases Explained! 🔗 #shorts #dns #coding

Sandy LaneSandy Lane
•

Video: What is a CNAME Record? DNS Aliases Explained! 🔗 #shorts #dns #coding by Taught by Celeste AI - AI Coding Coach

Watch full page →

What is a CNAME Record? DNS Aliases Explained!

A CNAME record in DNS creates an alias from one domain name to another, allowing multiple domain names to point to the same destination. This is useful for managing subdomains, CDNs, and cloud services by directing traffic through a canonical or primary domain name.

Code

; Example DNS zone file entries showing a CNAME record
blog.example.com.    3600    IN    CNAME    example.github.io.

; The browser resolves blog.example.com by following the CNAME to example.github.io,
; then looks up the A record for example.github.io to get the actual IP address.

Key Points

  • A CNAME record creates an alias from one domain name to another canonical domain name.
  • The DNS resolver follows the CNAME chain until it reaches an A record with the IP address.
  • CNAMEs are ideal for managing subdomains, content delivery networks (CDNs), and cloud services.
  • They simplify domain management by pointing multiple names to a single canonical domain.