DNS - CNAME (Canonical Name) record (Alias)

> NetWork > Network - Name

1 - About

A CNAME (Canonical Name) is a type of DNS record that maps one domain name to another name.

It brings a Domain Name Alias functionality (synonym).

When a DNS resolver encounters a CNAME record:

  • it will query the server again using the result of the CNAME as input
  • until it found an IP.
Advertising

3 - Example

On the below domain data, we see:

NAME                    TYPE   VALUE
--------------------------------------------------
bar.example.com.        CNAME  foo.example.com.
foo.example.com.        A      192.0.2.23

When a DNS query is performed against bar.example.com, the resolver:

  • will get a CNAME record with the value foo.example.com
  • will query the domain table again with the value foo.example.com and get an A record
  • and will return the IP 192.0.2.23

4 - Documentation / Reference