What is a DNS CNAME (Canonical Name) ?

Map Of Internet 1973

About

A CNAME (Canonical Name) is a type of DNS record that maps:

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.

Alias

It brings an alias functionality (synonym).

You can achieve the same alias functionality with the alias record but faster because there is only one query needed as the alias record points directly to an IP.

Unicity

CNAMEs are, according to DNS standards, meant to be the only record in a host's DNS records. Therefore, no other record type can be set with the same name.

It means that you shouldn't create a CNAME for your apex domain because the apex domain is generally also set:

  • in the MX record in order to receive email
  • or other validation TXT records (SPF, …)

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

SEO

To redirect to a name to a server (known as a custom domain), you may use:

  • a CNAME
  • or a A or AAAA record , (directly linked to the IP addresses)

By using a CNAME, the server is not considered as a 1st party server by search engine 1). The script and cookies could be considered as third-party.

Usage

Specification

DNS CNAME records are specified in search/rfc_search_detail.php and clarified in Section 10 of RFC 2181.

2)

Cname as Default record behavior

When a name server fails to find a desired record (RR)

  • it checks to see if the resource set consists of a CNAME record with a matching class.
  • if so, the name server includes the CNAME record in the response and restarts the query at the domain name specified in the data field of the CNAME record.

See full rule at Section 3.6.2





Discover More
Ezoic Cloudflare Dns
Advertising - Ezoic Ad Platform (Ez)

Ezoic is an ad platform. a minimum of 10,000 visits per month (not really) More ... ...
Map Of Internet 1973
DNS - Record

A DNS record is a row in a DNS database. Example of a A record. where: api is a relative name IN is the INTERNET class (An other value is ANY) A is the A record 164.132.99.202 is the Ip address...
Map Of Internet 1973
DNS Alias record

An alias is a DNS record with a name that resolves directly to an ip_address. cnamenamenamean ip addressDNS resolverroundtripip_addressCNAME Before creating an ALIAS record, check there are no: ...
Map Of Internet 1973
DNS Database

The DNS database is the DNS repository that contains all DNS record of a domain The domain provider should have a graphical interface to modify records but at the end, this record are stored in a text...
Map Of Internet 1973
What is a Domain Name in DNS ?

The term domain name is a name: in the Domain NameSpace (DNS) that identifies an object (known also as node) in the domain database (ie a DNS database or a local host file) It's also known as...
Map Of Internet 1973
What is a MX DNS record (Mail Exchanger Record)?

The MX DNS is a DNS record that defines the mail delivery smtp server. You can only use one mail exchange server at a time for a specific domain name (ie domain or subdomain). The name of the MX record...



Share this page:
Follow us:
Task Runner