The Domain Name System (DNS) enables surfing on the World Wide Web as we know it: A user enters a domain name in the form of a URL in order to arrive at the desired website. The actual com­mu­ni­ca­tion, however, occurs via an in­di­vid­ual IP address. The DNS is based on zone file records. The actual name res­o­lu­tion uses the important types of A and AAAA records.

Note

There many different types of records. In our com­pre­hen­sive article on DNS records, we not only explain the records’ basic char­ac­ter­is­tics, we also provide a chart sum­ma­riz­ing all the different types.

However, an IP address isn’t always linked with one domain name. Several names can also refer to the same IP address. To enable this, the DNS uses CNAME records.

What Are CNAME Records?

The DNS is based on a de­cen­tral­ized, organized server network. Name servers ad­min­is­ter specific zones and have zone files at their disposal to this end. These are simple text files in which different DNS records are listed line by line. The records are composed of different types. To link the domain names with an IPv4 address, you need to choose type A record. With the CNAME type, a domain name is linked with an alias – i.e. another name under which the same offering can be reached.

The actual name is the one connected with the IP address in an A record. The advantage here is that should the IP address change, you only have to adjust the A record. Since all aliases in turn refer to this type A record (or type AAAA record), the CNAME records are im­me­di­ate­ly adjusted at the same time.

Fact

The CNAME des­ig­na­tion is a port­man­teau of “canonical name” – the name regarded as the standard. For this reason, the des­ig­na­tion is also somewhat confusing, as the record doesn’t even establish the “actual” domain name, but rather its alias.

The CNAME Syntax

DNS records follow a stan­dard­ized syntax with various fields:

  • <name>: The domain’s alias appears in the first field.
  • <ttl>: The “time to live” is the term for the time that a record may be held in the cache before the in­for­ma­tion has to be requested again.
  • <class>: The class field is optional and specifies the type of network for which the record is valid.
  • <type>: This field de­ter­mines the record type – in this case, CNAME.
  • <rdata>: The last field contains the in­for­ma­tion that the record actually refers to. Here, it is therefore the actual domain name.

The fields are simply separated by spaces and arranged within a line.

<name> <ttl> <class> <type> <rdata>

The time to live (TTL) specifies the duration of the in­for­ma­tion’s validity. The provider guar­an­tees that the data is correct within this time period and for this reason may remain in the cache. If the time lapses, the in­for­ma­tion must again be recalled from the server. In practice, however, the field only appears rarely in the in­di­vid­ual records. Instead, a TTL is globally de­ter­mined for the entire zone. The in­di­vid­ual records then take on this value.

Today, the optional field for class has only a his­tor­i­cal value: While DNS was being developed, the networks Hesiod (HS) and Chaosnet (CH) – both no longer in existence – were orig­i­nal­ly both a pos­si­bil­i­ty. Now only the internet remains. This is why one either finds in this place the ab­bre­vi­a­tion IN, or the field is com­plete­ly omitted.

Names in the DNS records are always specified in the Fully Qualified Domain Names (FQDNs) format. This means that the spec­i­fi­ca­tion ends with a period. The reason for this is that FQDNs follow a domain’s complete path – and this begins (from the far right) with the root server. Because the cor­re­spond­ing field is empty, only the period sep­a­rat­ing the com­po­nents from each other remains.

Note

A CNAME record must always refer to another domain. It is not per­mis­si­ble to instead insert an IP address. What’s more, it is not per­mis­si­ble to use the defined alias in other record types. It is also rec­om­mend­ed not to allow a CNAME record to refer to another CNAME record. Although that doesn’t lead to an error, it does make the zone file un­nec­es­sar­i­ly complex.

CNAME Example

In practice, a CNAME record looks like this:

www.example.net. CNAME www.example.com.

In order for the reference to work through CNAME, an A and/or AAAA record must also be available in the zone file.

$TTL 11107
www.example.com.	IN	A		93.184.216.34
www.example.com.	IN	AAAA		2606:2800:220:1:248:1893:25c8:1946
www.example.net.	IN	CNAME		www.example.com.
www.example.org.	IN	CNAME		www.example.com.

Both CNAME records refer to the A and/or AAAA record. The time to live is set globally for the entire zone (rep­re­sent­ed by the dollar sign) at 11,107 seconds, thereby totaling more than three hours.

CNAME Check: How You Can Find the CNAME Record

If you’d like to find out a website’s CNAME record, you can either turn to a special software program or simply use a web service for this purpose. With Public DNS, Google provides a separate DNS server that you can use to access the various website DNS records.

On the Public DNS website, you enter the desired domain whose CNAME you would like to check. On the following page, you should change the RR type (by default, this is set to A) to the CNAME record; then you have to click on the resolve button again to receive the result.

Both settings for the EDNS client subnet and DNSSEC can remain unchanged. The former is a mechanism that is supposed to capture the requestor’s location, and in this way deliver more efficient results – currently, however, it is only promoted by Google and OpenDNS. DNSSEC, on the other hand, guar­an­tees the user that the in­for­ma­tion has not been ma­nip­u­lat­ed by a third party who may have in­ter­cept­ed the com­mu­ni­ca­tion unnoticed.

Go to Main Menu