Background

The 'CNAME' Resource Record (RR) is standarized in RFC 1035 and defines an alias for an existing host defined by an 'A' or 'AAAA' resource record.


Details

RR Type: CNAME
ID: 5 (0x0005)
Defining RFC: RFC 1035,  Section 3.3.1,  Page 14
Description: Canonical name record
Function: Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
Status: Active

'CNAME' RR Syntax

name ttl class type rdata {canonical-name}

RR Field Example Description
name ftp The name is unqualified, causing $ORIGIN substitution. You can also write this as a fully qualified domain name (FQDN) such as ftp.yourdomain.com.

Blank Name - A record that has nothing in the 'name' field gets used for all requests being made to the base domain such as yourdomain.com. (Same as Parent)
ttl This is the records time to live value (in seconds). If there is no TTL specified, the zone's default $TTL Directive will be used.
class IN Specifies the class to be 'Internet'.
type CNAME Specifies the RDATA field will contain data in the CNAME RDATA format.
rdata canonical-name ftp.yourdomain.com. Specifies that name 'ftp.yourdomain.com.' is aliased to the host 'ftp01.hosting.net.' in a foreign or external domain.

Examples

Snippets from a fictitious forward lookup 'yourdomain.com' zone file

Typical 'CNAME' Record Entry

;
;   Zone records
;
ftp IN CNAME ftp01.hosting.net.

CNAME RRs are often used when assigning service names to existing hosts, for example, if a host is actually called 'server01' but also runs an FTP and WEB service then CNAME records are fequenly used to define these services as in the following example:

ftp IN CNAME server01
web IN CNAME server01
server01 IN A 104.16.44.99

Invalid Configurations

CNAME records should not be used with either NS or MX records.
Although the following example may work, its technically invalid and should be avoided.

IN MX mail.yourdomain.com
mail IN CNAME server01.yourdomain.com
server01 IN A 104.16.44.99


See Also




This content was last updated on December 9, 2020
An error has occurred. This application may no longer respond until reloaded. Reload 🗙