Glossary Hero

DNS CNAME Record

In DNS, CNAME is short for Canonical Name. A CNAME creates an alias for other DNS names.

What is a CNAME Record?

When an admin creates a CNAME record, they are creating a record that points to anotherDNS recordinstead of an IP address (like in the case of anA record, for example). A CNAME will act as an alias. Essentially is an end users is typing in a URL that correlates with a CNAME, a DNS lookup will be performed to find that CNAME and then another lookup will be performed to find the A record which will send back an IP address to enable communication between the end user and the destination.

A CNAME record may point to an A record, but could also point to another CNAME record. In this case, though, even more lookups will be performed which may impact user experience because there will be added latency.

CNAME Record Example

Record

Type

Value

two.menandmice.com

CNAME

one.menandmice.com

one.menandmice.com

A

192.168.100.2

How does a CNAME Record work?

There are a few different use cases for CNAME records. In general, what companies do is rather than creating A records for every subdomain they might have. They’ll create an A record for their root domain, and then create several CNAME records for each of their subdomains. The end user will then be redirected to the root domain if they type in a URL that specifies a sub-domain.

blog.example.com in this case would lead the end user to example.com:

Record

Type

Value

two.menandmice.com

CNAME

example.com

example.com

A

192.168.100.5

An end user in the above example would type in blog.example.com. The Domain Name System would start to look that name up, but see that it’s a CNAME record and restart the query for example.com. This leads them to an IP address which begins to open the line of communication.

In the case of a CNAME leading to a CNAME, this leads to multiple queries:

Record

Type

Value

blogs.example.com

CNAME

blog.example.com

blog.example.com

CNAME

example.com

example.com

A

192.168.100.5

A better way to do the above example:

Record

Type

Value

blogs.example.com

CNAME

example.com

blog.example.com

CNAME

example.com

example.com

A

192.168.100.5