Markdown

CNAME

CNAME is the Acronym for Canonical Name

A type of DNS (Domain Name System) record that creates an alias for one domain name to point to another. Think of it as a nickname or a shortcut.

When a CNAME record is set up, it tells the DNS system that any requests for the alias domain should be directed to the canonical (real) domain. This can prove convenient when running multiple services (like an FTP server and a web server, each running on different ports) from a single IP address. One can, for example, use CNAME records to point ftp.example.com and www.example.com to the DNS entry for example.com, which in turn has an A record which points to the IP address. Then, if the IP address ever changes, one only has to record the change in one place within the network: in the DNS A record for example.com. CNAME records must always point to another domain name, never directly to an IP address.

How CNAME Works

A CNAME record always points to another domain name, not directly to an IP address. Additionally, it cannot be used for the root domain itself, and excessive chaining of CNAME records can negatively impact performance.

  • Usage examples: Pointing www.example.com to example.com
  • Usage examples: Pointing blog.example.com to a blogging platform's domain
  • Usage examples: Using different domain names for different services hosted on the same server

Common Use Cases

A website hosted at example.com can also be made accessible via www.example.com by creating a CNAME (Canonical Name) record for the latter, pointing it to the former. When a user types www.example.com into their browser, the Domain Name System (DNS) follows the CNAME record and directs them to the content hosted at the root domain, example.com.

Articles Tagged CNAME

View Additional Articles Tagged CNAME