CNAME record

CNAME record

A CNAME record or Canonical Name record is a type of resource record in the Domain Name System (DNS) that specifies that the domain name is an alias of another, canonical domain name. This helps when running multiple services (like an FTP server and a webserver; each running on different ports) from a single IP address. Each service can then have its own entry in DNS (like ftp.example.com. and www.example.com.). Network administrators also use CNAMEs when running multiple HTTP servers on the same port, with different names, on the same physical host.

Contents

Details

CNAME records are specified in RFC 1034. 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 CNAME alias 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:

foo.example.com.        CNAME  bar.example.com.
bar.example.com.        A      192.0.2.23

When an A record lookup for foo.example.com is done, the resolver will see a CNAME record and restart the checking at bar.example.com and will then return 192.0.2.23.

Which is the "CNAME"?

RFC 2181, "Clarifications to the DNS Specification", includes a warning on the use of the word "CNAME". "The CNAME" or "a CNAME" is often used to refer to the label, or left-hand part, of a CNAME record. However, as "CNAME" is an abbreviation of "canonical name", this usage is inaccurate; the 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:

foo.example.com.        CNAME  bar.example.com.

may be read as:

foo.example.com is an alias for the canonical name (CNAME) bar.example.com.

The canonical name itself must be defined by a record other than a CNAME or DNAME record.

Restrictions

  • 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:
foo.example.com.  CNAME  bar.example.com.
bar.example.com.  CNAME  foo.example.com.
  • Other DNS record types, such as NS, MX, PTR, SRV, etc. that point to other names should never point to a CNAME alias.[2][3] So, for example, a zone should not contain constructs such as:
example.com.      MX     0   foo.example.com.
foo.example.com.  CNAME  host.example.com.
host.example.com. A      192.0.2.1
  • Domains that are used for e-mail may not have a CNAME record[4]. In practice this may work, but can have different behavior with different mail servers, and can have undesired effects.[5]

DNAME record

A DNAME record or Delegation Name record is defined by RFC 2672. A DNAME record creates an alias for one or more subdomains of a domain. In contrast, the CNAME record creates an alias only of 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 synthesizes a CNAME record to simulate the semantics of the DNAME record.

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

foo.example.com.        DNAME  bar.example.com.
bar.example.com.        A      192.0.2.23
xyzzy.bar.example.com.  A      192.0.2.24
*.bar.example.com       A      192.0.2.25

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

However, a lookup for xyzzy.foo.example.com will be DNAME mapped and return the A record for xyzzy.bar.example.com which is 192.0.2.24; if the DNAME record had been a CNAME record, this request would have failed.

Lastly, a request for baz.foo.example.com would be DNAME mapped and return 192.0.2.25.

See also

References

  1. ^ "RFC 2181: Clarifications to the DNS Specification". IETF. July 1997. http://tools.ietf.org/html/rfc2181#section-10.1.1. Retrieved 2011-03-09. 
  2. ^ a b Mockapetris, P. (November 1987). "RFC1034 - Domain Names, Concepts and Facilities" (in En-US). ISI. http://www.faqs.org/rfcs/rfc1034.html. Retrieved 16 April 2011. 
  3. ^ Barr, D. (February 1996). "Common DNS Operational and Configuration Errors" (in En-US). RFC1912. The Pennsylvania State University. http://www.faqs.org/rfcs/rfc1912.html. Retrieved 16 April 2011. 
  4. ^ Braden, R. (October 1989). "RFC1123 - MAIL - SMTP & RFC-822" (in En-US). http://www.ietf.org/rfc/rfc1123.txt. Retrieved 3 June 2011. 
  5. ^ Bernstein, D.J.. "CNAME records in mail" (in En-US). http://cr.yp.to/im/cname.html. Retrieved 3 June 2011. 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • CNAME-Record — Mit einem CNAME Resource Record (CNAME für eng. canonical name) wird zu einem vorhandenen DNS Namen ein Alias Name definiert. Links im Resource Record (RR) steht der Alias Name und rechts der Original Name oder in der DNS Terminologie: der… …   Deutsch Wikipedia

  • CNAME Resource Record — Ein CNAME Resource Record (CNAME RR) ist im Domain Name System dazu vorgesehen, mit einem Namen auf einen anderen Namen zu verweisen. Der Name des CNAME RR verweist auf einen sogenannten canonical name (CNAME). Im einfachsten Fall verweist der… …   Deutsch Wikipedia

  • CNAME — Mit einem CNAME Resource Record (CNAME für eng. canonical name) wird zu einem vorhandenen DNS Namen ein Alias Name definiert. Links im Resource Record (RR) steht der Alias Name und rechts der Original Name oder in der DNS Terminologie: der… …   Deutsch Wikipedia

  • List of DNS record types — This List of DNS record types provides an overview of types of resource records (database records) stored in the zone files of the Domain Name System (DNS). The DNS implements a distributed, hierarchical, and redundant database for information… …   Wikipedia

  • Resource-Record — Ein Resource Record (RR) ist die kleinste Informationseinheit im Domain Name System (DNS). Er tritt in ASCII Darstellung in Zonendateien oder in komprimierter Form in DNS Transport Paketen oder DNS Caches auf. Einige RR Typen – sogenannte Pseudo… …   Deutsch Wikipedia

  • Resource Record — Ein Resource Record (RR) ist die grundlegende Informationseinheit im Domain Name System (DNS). Er tritt in ASCII Darstellung in Zonendateien oder in komprimierter Form in DNS Transport Paketen oder DNS Caches auf. Einige RR Typen – sogenannte… …   Deutsch Wikipedia

  • PTR-Record — PTR (kurz für Pointer ) Resource Records ordnen im Domain Name System einer gegebenen IP Adresse einen oder mehrere Hostname(s) zu. Sie stellen damit gewissermaßen das Gegenstück zur klassischen Zuordnung einer oder mehrerer IP Adresse(n) zu… …   Deutsch Wikipedia

  • MX record — A mail exchanger record (MX record) is a type of resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient s domain and a preference value used to prioritize mail… …   Wikipedia

  • SRV record — An SRV record or Service record is a category of data in the Internet Domain Name System specifying information on available services. It is defined in RFC 2782. Newer internet protocols such as SIP and XMPP often require SRV support from clients …   Wikipedia

  • Wildcard DNS record — A wildcard DNS record is a record in a DNS zone that will match requests for non existent domain names. A wildcard DNS record is specified by using a * as the left most label (part) of a domain name, e.g. *.example.com. The exact rules about when …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”