Skip to main content

CNAME records

CNAME records point a hostname to its canonical name. Use them when a name such as www.example.com should resolve through another hostname, such as app.example.net.

What a CNAME record is

A CNAME record identifies the canonical name for another hostname. For example, a CNAME record for www.example.com could specify app.example.net as its target.

The target must be a hostname, rather than an IP address or URL. Use an A record for an IPv4 address or an AAAA record for an IPv6 address.

A CNAME controls DNS resolution. It does not configure an HTTP redirect or change the address displayed in a browser. The destination service must be configured to accept requests for the original hostname, such as www.example.com.

For secondary zones, make record changes at the primary DNS provider. See Secondary DNS zones for details.

Explore CNAME records on the Records page

To view CNAME records, go to DNS > Zones, select Primary zones, open the zone, and select the Records tab.

In Grouped view, expand CNAME (Canonical Name).

The table displays the following information:

Column

Description

Record name

The complete DNS name, including the zone name

Target hostname

The canonical hostname specified by the CNAME record

TTL

How long the record can be cached, in seconds

Use Search to locate a record or switch to Table view to review records in a table. The reorder control lets you adjust which record type groups are displayed and their order.

Each row provides an actions menu for editing or deleting the record. Select row checkboxes to perform bulk deletion.

Create a CNAME record

To create a CNAME record, open the zone’s Records tab:

  1. Select Add record, either at the top of the page or beside CNAME (Canonical Name).

  2. Set Record type to CNAME (Canonical Name).

  3. Enter the Name. The name cannot be the zone apex.

  4. Enter the TTL in seconds.

  5. Enter the Target hostname, using a relative hostname or an absolute hostname ending with a dot.

  6. Select Save and close, or Save and add another to continue creating records.

    If a duplicate is found when you save, a banner directs you to edit the existing record. Update that entry instead of creating another.

The form contains these fields:

Field

Description

Record type

The DNS record type; select CNAME (Canonical Name)

Name

The name within the zone that will point to the canonical hostname; the zone apex is not permitted

TTL

The cache duration, in seconds

Target hostname

The relative or absolute canonical hostname to which the record points

The zone name appears beneath Name. For a zone named example.com, these entries produce the following names:

Name entered

Resulting record name

www

www.example.com

app

app.example.com

portal

portal.example.com

You can also add records through Import records. See Import DNS records for supported formats and validation behavior.

Update a CNAME record

  1. Locate the record on the Records tab.

  2. Open its actions menu and select Edit.

    The Record type and Name fields are read-only in the edit form.

  3. Update the TTL or Target hostname.

  4. Select Update.

Delete a CNAME record

To delete a CNAME record, open its actions menu, select Delete, and confirm the deletion.

To delete multiple entries from the Records page:

  1. Select the checkboxes beside the records.

  2. Select Delete in the selection toolbar.

  3. Review the names listed in the confirmation dialog.

  4. Select Delete.

Deletion cannot be undone. Deleting a CNAME removes the reference to its canonical hostname but does not delete records at that target. Previously cached answers may remain available until their TTL expires.

Relative and absolute target hostnames

The trailing dot determines how DigiCert®​​ DNS interprets Target hostname.

A target without a trailing dot is relative to the current zone. A target with a trailing dot is an absolute fully qualified domain name (FQDN).

For a zone named example.com:

Target entered

Interpreted target

app

app.example.com

app.example.net.

app.example.net

app.example.net

app.example.net.example.com

For a target outside the current zone, include the trailing dot to prevent the zone name from being appended.

A dot (.) alone cannot be used as the target hostname. Do not include a URL scheme such as https://, a port number, or a path.

Record conflicts and the zone apex

A CNAME record specifies one target hostname. It cannot share its record name with ordinary DNS records such as A, AAAA, MX, or TXT records. DNSSEC metadata is an exception to this restriction.

Before creating a CNAME record, check whether its proposed name already has records configured. If it does, choose a different record name or review the existing configuration before replacing it.

This restriction applies to the CNAME record’s name. The target hostname can have the A or AAAA records needed to resolve to an address.

A CNAME cannot be created at the zone apex, such as example.com, because that name must also contain the zone’s SOA and NS records. Use a name within the zone, such as www.example.com, for the CNAME record.

For direct address mappings at the apex, see A records and AAAA records.

CNAME chains and loops

A CNAME chain occurs when a CNAME record points to a hostname that also has a CNAME record. For example, www.example.com might point to app.example.net, which points to origin.example.net.

Resolving a chain requires following each CNAME record to the final target. Keep chains short and, where possible, point directly to the intended canonical hostname.

A loop occurs when a CNAME record points to its own name or a sequence of CNAME records leads back to an earlier name. For example, www.example.com pointing to app.example.com, and app.example.com pointing back to www.example.com, creates a loop.

Loops prevent successful resolution. Check the target and any subsequent CNAME records before saving a change.

For region-specific CNAME configurations, see Regional views.

TTL and record changes

The TTL, or time to live, specifies how long the CNAME record can be cached before it expires. Enter this value in seconds.

For example, a TTL of 300 represents five minutes.

After you update the target hostname, resolvers may continue using the previously cached CNAME record until its TTL expires. Changing the TTL does not shorten the lifetime of copies already cached using the previous value.

The CNAME record and records at its target have their own TTLs. Changing the CNAME’s TTL does not change the TTL of the target’s address records.

When planning a target change, consider lowering the TTL in advance and allowing the previous TTL to expire before changing the destination.