After you add a domain name to Dynamic Route for CDN (DCDN), the system assigns a CNAME to the domain name. You must add a CNAME record in the system of your DNS service provider to map the domain name to the CNAME before requests can be redirected to DCDN nodes. Otherwise, DCDN acceleration cannot take effect. This topic describes how to add a CNAME record.

The following information describes how to add a CNAME record at different DNS service providers:

Prerequisites

A domain name is added to DCDN. For more information about how to add a domain name to DCDN, see Add a domain name.

Notice
  • Make sure that the DNS records do not conflict with each other in the same system.
  • CNAMEs that are assigned by Alibaba Cloud CDN, DCDN, ApsaraVideo Live, or ApsaraVideo VOD are used only for domain name resolution. If Alibaba Cloud discovers that your CNAME is used for malicious activities, Alibaba Cloud reserves the right to close your Alibaba Cloud account and remove the domain names.

Domain name overview

A domain name consists of several hierarchical levels that are separated by periods (.). The rightmost part is called the top-level domain name. The top-level domain name is also called the suffix. Common top-level domain names include .com, .org, .net, and .cn. Some top-level domain names may contain two hierarchical levels, such as .com.cn, .org.cn, and .net.cn.

  • A top-level domain name combined with a unique domain name is called a root domain name, such as aliyundoc.com and aliyundoc.com.cn.
  • A third-level domain name is a lower level of the root domain name, such as example.aliyundoc.com and example.aliyundoc.com.cn.
  • A fourth-level domain name is a lower level of the third-level domain name, such as www.example.aliyundoc.com and www.example.aliyundoc.com.cn.

Third-level domain names and fourth-level domain names are also called subdomain names.

Add a CNAME record on Alibaba Cloud

If your DNS service provider is Alibaba Cloud, perform the following steps to add a CNAME record for the domain name:

  1. Log on to the DCDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Domain names
  2. Add a CNAME record.
    1. Log on to the Alibaba Cloud DNS console with the Alibaba Cloud account to which the domain name belongs.
    2. Optional: In the Alibaba Cloud DNS console, add a domain name that is not registered through Alibaba Cloud Domains.
      Note If the domain name is not registered through Alibaba Cloud Domains, you must add the domain name to Alibaba Cloud DNS before you can add a DNS record for it. For more information, see Domain Management. If the domain name is registered through Alibaba Cloud Domains, skip this step.
    3. On the Manage DNS page, find the root domain name of your domain name that you want to manage and click Configure in the Actions column.
    4. Click Add Record and add a CNAME record.
      Note The CNAME record of a specific domain name takes precedence over that of a wildcard domain name. If the domain name to be accelerated is a wildcard domain name, and the host record includes an asterisk (*), you must delete all effective DNS records of the second-level domain names that match the wildcard domain name.
      Add a CNAME record
      Parameter Description Example
      Type Select CNAME from the drop-down list. CNAME
      Host
      • If the domain name to be accelerated is a root domain name, enter @.
      • If the domain name to be accelerated is a wildcard domain name, enter *.
      • If the domain name to be accelerated is a subdomain name, enter the prefix of the subdomain name.

      For more information about subdomain names, see Domain name overview.

      • The domain name to be accelerated is a root domain name
        • If the domain name to be accelerated is aliyundoc.com, enter @.
        • If the domain name to be accelerated is aliyundoc.com.cn, enter @.
      • The domain name to be accelerated is a wildcard domain name
        • If the domain name to be accelerated is .aliyundoc.com, enter *.
        • If the domain name to be accelerated is .aliyundoc.com.cn, enter *.
        • If the domain name to be accelerated is *.example.aliyundoc.com, enter *.example.
        • If the domain name to be accelerated is *.example.aliyundoc.com.cn, enter *.example.
      • The domain name to be accelerated is a subdomain name
        • If the domain name to be accelerated is example.aliyundoc.com, enter example.
        • If the domain name to be accelerated is example.aliyundoc.com.cn, enter example.
        • If the domain name to be accelerated is www.example.aliyundoc.com, enter www.example.
        • If the domain name to be accelerated is www.example.aliyundoc.com.cn, enter www.example.
      Note .com.cn is a top-level domain name that consists of two hierarchical levels.
      ISP Line The default ISP line. We recommend that you keep the default setting.
      Value
      Enter the CNAME of the domain name.
      Note Each accelerated domain name is assigned a unique CNAME. Third-level domain names cannot use the CNAME of the root domain name. If you want to accelerate a third-level domain name, add the third-level domain name to DCDN. Alibaba Cloud then assigns a CNAME to the third-level domain name. Alternatively, you can add a wildcard domain name to DCDN. Third-level domain names that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.
      www.example.com.w.kunlunsl.com
      TTL Enter a time-to-live (TTL) value for the CNAME record. A smaller value indicates a shorter period of time to apply record updates. The default TTL value is 10 minutes. We recommend that you keep the default setting.
    5. Click OK.
      If you add a CNAME record, it takes effect immediately. If you modify a CNAME record, it takes 10 minutes for the updates to take effect because the default TTL value of a CNAME record is 10 minutes. The time period varies based on the TTL value that you specify for the CNAME record. The system may prompt that you must add a CNAME record. Ignore the message.

Add a CNAME record on Tencent Cloud

If your DNS service provider is Tencent Cloud, perform the following steps to add a CNAME record for the domain name:

  1. Log on to the DCDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Domain names
  2. Add a CNAME record.
    1. Log on to the DNSPod console.
    2. On the DNSPod page, click Add Records and add a CNAME record.
      Parameter Description Example
      Host
      • If the domain name to be accelerated is a root domain name, enter @.
      • If the domain name to be accelerated is a wildcard domain name, enter *.
      • If the domain name to be accelerated is a subdomain name, enter the prefix of the subdomain name.

      For more information about subdomain names, see Domain name overview.

      • The domain name to be accelerated is a root domain name
        • If the domain name to be accelerated is aliyundoc.com, enter @.
        • If the domain name to be accelerated is aliyundoc.com.cn, enter @.
      • The domain name to be accelerated is a wildcard domain name
        • If the domain name to be accelerated is .aliyundoc.com, enter *.
        • If the domain name to be accelerated is .aliyundoc.com.cn, enter *.
        • If the domain name to be accelerated is *.example.aliyundoc.com, enter *.example.
        • If the domain name to be accelerated is *.example.aliyundoc.com.cn, enter *.example.
      • The domain name to be accelerated is a subdomain name
        • If the domain name to be accelerated is example.aliyundoc.com, enter example.
        • If the domain name to be accelerated is example.aliyundoc.com.cn, enter example.
        • If the domain name to be accelerated is www.example.aliyundoc.com, enter www.example.
        • If the domain name to be accelerated is www.example.aliyundoc.com.cn, enter www.example.
      Note .com.cn is a top-level domain name that consists of two hierarchical levels.
      Type Select CNAME from the drop-down list. CNAME
      Split Zone Select Default from the drop-down list. We recommend that you keep the default setting.
      Value
      Enter the CNAME of the domain name.
      Note Each accelerated domain name is assigned a unique CNAME. Third-level domain names cannot use the CNAME of the root domain name. If you want to accelerate a third-level domain name, add the third-level domain name to DCDN. Alibaba Cloud then assigns a CNAME to the third-level domain name. Alternatively, you can add a wildcard domain name to DCDN. Third-level domain names that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.
      www.example.com.w.kunlunsl.com
      Weight You do not need to set this parameter. N/A
      MX You do not need to set this parameter. N/A
      TTL Enter a TTL value for the CNAME record. A smaller value indicates a shorter period of time to apply record updates. We recommend that you keep the default setting.
    3. Click Confirm.
      If you add a CNAME record, it takes effect immediately. If you modify a CNAME record, it takes 10 minutes for the updates to take effect because the default TTL value of a CNAME record is 10 minutes. The time period varies based on the TTL value that you specify for the CNAME record. The system may prompt that you must add a CNAME record. Ignore the message.

Add a CNAME record on Xinnet

If your DNS service provider is Xinnet, perform the following steps to add a CNAME record for the domain name:

  1. Log on to the DCDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Domain names
  2. Add a CNAME record.
    1. Log on to Xinnet.
    2. Navigate to the DNS records page and find the domain name that you want to manage. Click Add CNAME Record and add a CNAME record.
      Parameter Description Example
      CNAME Enter the CNAME that is assigned to the domain name.
      Note Each accelerated domain name is assigned a unique CNAME. Third-level domain names cannot use the CNAME of the root domain name. If you want to accelerate a third-level domain name, add the third-level domain name to DCDN. Alibaba Cloud then assigns a CNAME to the third-level domain name. Alternatively, you can add a wildcard domain name to DCDN. Third-level domain names that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.
      www.example.com.w.kunlunsl.com
      Points To
      • If the domain name to be accelerated is a root domain name, enter @.
      • If the domain name to be accelerated is a wildcard domain name, enter *.
      • If the domain name to be accelerated is a subdomain name, enter the prefix of the subdomain name.
      • The domain name to be accelerated is a root domain name
        • If the domain name to be accelerated is aliyundoc.com, enter @.
        • If the domain name to be accelerated is aliyundoc.com.cn, enter @.
      • The domain name to be accelerated is a wildcard domain name
        • If the domain name to be accelerated is .aliyundoc.com, enter *.
        • If the domain name to be accelerated is .aliyundoc.com.cn, enter *.
        • If the domain name to be accelerated is *.example.aliyundoc.com, enter *.example.
        • If the domain name to be accelerated is *.example.aliyundoc.com.cn, enter *.example.
      • The domain name to be accelerated is a subdomain name
        • If the domain name to be accelerated is example.aliyundoc.com, enter example.
        • If the domain name to be accelerated is example.aliyundoc.com.cn, enter example.
        • If the domain name to be accelerated is www.example.aliyundoc.com, enter www.example.
        • If the domain name to be accelerated is www.example.aliyundoc.com.cn, enter www.example.
      TTL Enter a TTL value for the CNAME record. A smaller value indicates a shorter period of time to apply record updates. We recommend that you keep the default setting.
    3. Click Submit.
      If you add a CNAME record, it takes effect immediately. If you modify a CNAME record, it takes 10 minutes for the updates to take effect because the default TTL value of a CNAME record is 10 minutes. The time period varies based on the TTL value that you specify for the CNAME record. The system may prompt that you must add a CNAME record. Ignore the message.

Check whether the CNAME record takes effect

  • Method 1: Quick verification in the DCDN console
    1. Log on to the DCDN console and navigate to the Domain Names page.
    2. Select the domain name and move the pointer over the CNAME Status column. The CNAME Configuration Guide tooltip appears.
    3. Click Open Configuration Guide and then click Search.
  • Method 2: Run the ping command to ping the domain name
    1. Open Command Prompt in Windows.
    2. Run the ping command to ping the domain name. If the CNAME in the output matches the CNAME that is assigned to the domain name in the DCDN console, the DCDN service is enabled for the domain name. Check whether the CNAME record takes effect

References

If the cache hit ratio is lower than expected after you use DCDN to accelerate content delivery for a domain name, you can configure and enable the prefetch feature. The prefetch feature allows DCDN to prefetch content from origin servers to DCDN nodes during off-peak hours. This increases the cache hit ratio. For more information, see Refresh and prefetch resources.