What are CNAME (Canonical Name) Records?
CNAME records are referred to as alias records as they point a host name to another host name or FQDN. CNAME records are used to point multiple hosts to a single location, without specifically assigning an A record to each host name. CNAME records can also be used to point a host name to a location that is external to the domain.
To resolve a CNAME record, the name server must behave slightly differently than it would with a normal query of another record type. When a name server looks up a name and finds it is a CNAME record, it replaces the name with the canonical name (the target of the CNAME) and looks up the new name. In a sense, a CNAME lookup performs two queries to reach the final resolution.
Video Tutorial: How to Add, Edit, and Delete Records
CNAME Record Fields
|Name||This will be the host name for the record, typically a computer or server within your domain. It is important to note, the domain name is automatically appended to the Name field of the record. For example, defining www.example.com in DNS would be creating a CNAME record with the name field of “www” within the example.com domain. A CNAME record can not be defined for the root record of the domain as this is a violation of an RFC.|
|Alias to||This is the location that the host (defined in the Name field) will point to. This can point to another existing CNAME record in the domain, or another location external to the domain. It is important to note, the domain name is automatically appended to the end of this field (if it does not end in a dot).|
|TTL||The TTL (Time to Live) in seconds is the amount of time the record will cache resolving name servers and in web browsers. The longer the TTL, the less frequently remote systems will lookup the DNS record. This also means the domain will receive less query traffic. The shorter the TTL, then the faster DNS changes propagate in servers that have cached data. However, the higher the TTL ,then greater volume of query traffic the domain receives.
ADD A CNAME RECORD
4. In this screen, you will add the record information. Follow the steps below:
A) Name: This will be the hostname for your record. It is important to note, the domain name is automatically appended to the “Name” field of the record. Note the name field is required, because a CNAME record can not be defined for the root record of the domain.
B) TTL: Edit the TTL. Time to Live is measured in seconds and is the amount of time the record will cache in resolving name servers and web browsers.
C) Record Mode: The Record Mode will be left at Standard for this tutorial. Please note, the other Record Mode options are covered in different tutorials.
D) Host: Enter the destination host you would like this CNAME record to resolve to.
E) Note: Add a helpful note with keywords so you can search for your records later.
F) Save and Close: Save your changes. Don’t forget to commit your changes.
Information on the NX Domain feature can be found in the Disabling a Record tutorial.
5. There are two different ways you can point your CNAME to. First, you can point to an A Record within the same domain: www.example.com resolves to example.com. The tool tip at the top of the record configuration screen displays how the host will resolve.
6. Second way is to point the CNAME record to a value external to the domain: www.example.com resolves to constellix.com. Please note, the value field must end in a dot (.) to keep the example.com domain from being appended to the end of the value. The tool tip at the top of the record configuration screen displays how the host will resolve.
EDIT AN A RECORD
3. Under the CNAME Records section, select a record by clicking the check mark next to it, then click the icon to edit a record.
Please note, you can not edit a record that has not been committed following its creation.
DELETE A CNAME RECORD
3. Under the CNAME Records section select a record by clicking the check mark next to it, click the icon to delete a record.
Please note, you can not delete a record that has not been committed following its creation.
4. The record will now show as strike through text, and is now in the queue of changes to be committed.