World Library  
Flag as Inappropriate
Email this Article

CNAME record

Article Id: WHEBN0000636597
Reproduction Date:

Title: CNAME record  
Author: World Heritage Encyclopedia
Language: English
Subject: MX record, Content delivery network interconnection, WikiLeaks is not part of Wikipedia, SRV record, Google Sites
Collection: Domain Name System
Publisher: World Heritage Encyclopedia

CNAME record

A Canonical Name record (abbreviated as CNAME record) is a type of resource record in the Domain Name System (DNS) used to specify that a domain name is an alias for another domain, the "canonical" domain. All information, including subdomains, IP addresses, etc., are defined by the canonical domain.

This can prove convenient when running multiple services (like an FTP server and a webserver; each running on different ports) from a single IP address. One can, for example, point and to the DNS A record for, which in turn points to the IP-address. Then, if the IP-address ever changes, one only has to record the change in one place within the network: in the DNS A record.

CNAME records must always point to another domain name, never directly to an IP-address.


  • Details 1
    • Which side is the "CNAME"? 1.1
    • Restrictions 1.2
  • DNAME record 2
  • See also 3
  • References 4
  • External links 5


DNS CNAME records are specified in RFC 1034 and clarified in Section 10 of RFC 2181.

CNAME records are handled specially in the domain name system, and have several restrictions on their use. When a DNS resolver encounters a CNAME record while looking for a regular resource record, it will restart the query using the canonical name instead of the original name. (If the resolver is specifically told to look for CNAME records, the canonical name (right-hand side) is returned, rather than restarting the query.) The canonical name that a CNAME record points to can be anywhere in the DNS, whether local or on a remote server in a different DNS zone.

For example, if there is a DNS zone as follows:

NAME                    TYPE   VALUE
--------------------------------------------------        CNAME        A

when an A record lookup for is done, the resolver will see a CNAME record and restart the checking at and will then return

Which side is the "CNAME"?

As mentioned above, with a CNAME record one can point a name such as "" to "" Because of this, during casual discussion the "" (left-hand) side of a DNS entry will often be called "the CNAME" or "a CNAME." However, this is inaccurate. The canonical (true) name of "" is "" Because CNAME stands for Canonical Name, the right-hand side is the actual "CNAME."

This confusion is specifically mentioned in RFC 2181, "Clarifications to the DNS Specification." The left-hand label is an alias for the right-hand side (the RDATA portion), which is (or should be) a canonical name.[1] In other words, a CNAME record like this:        CNAME

may be read as: is an alias for the canonical name (CNAME) A client will request and the answer will be


  • CNAME records must always be pointed to another domain name, never to an IP-address.
  • An alias defined in a CNAME record must have no other resource records of other types (MX, A, etc.). (RFC 1034 section 3.6.2, RFC 1912 section 2.4) The exception is when DNSSEC is being used, in which case there can be DNSSEC related records such as RRSIG, NSEC, etc. (RFC 2181 section 10.1)
  • CNAME records that point to other CNAME records should be avoided due to their lack of efficiency, but are not an error.[2] It is possible, then, to create unresolvable loops with CNAME records, as in:  CNAME  CNAME
  • MX and NS records must never point to a CNAME alias (RFC 2181 section 10.3). So, for example, a zone must not contain constructs such as:      MX     0  CNAME A
  • Domains that are used for e-mail may not have a CNAME record.[3] In practice this may work, but can have different behavior with different mail servers, and can have undesired effects.[4]

DNAME record

A DNAME record or Delegation Name record is defined by RFC 6672 (original RFC 2672 is now obsolete). A DNAME record creates an alias for an entire subtree of the domain name tree. In contrast, the CNAME record creates an alias for a single name and not its subdomains. Like the CNAME record, the DNS lookup will continue by retrying the lookup with the new name. If a DNS resolver sends a query without EDNS, or with EDNS version 0, then a name server sends multiple CNAME records to simulate the DNAME record—CNAMEs for every node on a subtree have the same effect as a DNAME for the entire subtree.

For example, if there is a DNS zone as follows:        DNAME        A  A
*      A

An A record lookup for will fail because a DNAME is not a CNAME.

However, a look up for will be DNAME mapped and return the A record for which is; if the DNAME record had been a CNAME record, this request would have failed.

Lastly, a request for would be DNAME mapped and return

See also


  1. ^ "RFC 2181: Clarifications to the DNS Specification".  
  2. ^ Mockapetris, P. (November 1987). "RFC1034 - Domain Names, Concepts and Facilities". ISI. Retrieved 16 April 2011. 
  3. ^ Braden, R. (October 1989). "RFC1123 - MAIL - SMTP & RFC-822". Retrieved 3 June 2011. 
  4. ^ Bernstein, D.J. "CNAME records in mail". Retrieved 3 June 2011. 

External links

  • RFC 1912 is wrong Meng Weng Wong's analysis of CNAME restrictions (from
  • RFC 2219 – Use of DNS Aliases for Network Services
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.