Member-only story

What is a CNAME in DNS?

Aditya
1 min readMay 7, 2020

--

CNAME → CNAME stands for Canonical Name.CNAME records can be used to alias one name to another

Example → A common example is, let's say sprinkletwinkles.com and www.sprinkletwinkles.com pointing to the same application and hosted by the same server. In this case, to avoid maintaining two different records, it’s common to create:

  • An A record for sprinkletwinkles.com pointing to the server IP address
  • A CNAME record for www.sprinkletwinkles.com pointing to sprinkletwinkles.com

As a result, sprinkletwinkles.com points to the server IP address, and www.sprinklewrinkles.com points to the same address via sprinkletwinkles.com. Should the IP address change, you only need to update it in one place: just edit the Arecord for sprinkletwinkles.com, and www.sprinkletwinkles.com automatically inherits the changes.

--

--

Aditya
Aditya

Written by Aditya

Principal data engineer → Distributed Threat hunting security platform | aws certified solutions architect | gssp-java | Chicago-IL

No responses yet

Write a response