After you add a domain name to Alibaba Cloud CDN, 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 edge nodes. Otherwise, CDN acceleration cannot take effect. This topic describes how to add a CNAME record.

Prerequisites

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

Notice
  • Make sure that the DNS records do not conflict with each other in the same system.
  • The server that Alibaba Cloud CDN uses to resolve the CNAME of a domain name is deployed in mainland China. If you configure region-specific DNS settings for your domain names, for example, you add a CNAME record for your domain name in regions outside mainland China, including Hong Kong (China), Macao (China), Taiwan (China), the domain name cannot be mapped to the CNAME. The status of the CNAME is Pending Configuration in the Alibaba Cloud CDN console. However, CDN acceleration for the domain name is not affected.

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. For more information, see Terms.

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 Alibaba Cloud CDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Click 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 CDN 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 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 domain name.

      For more information about subdomain name, 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, 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, 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. Second-level domain names cannot use the CNAME of the top-level domain name. If you want to accelerate a second-level domain name, add the second-level domain name to Alibaba Cloud CDN. Alibaba Cloud then assigns a CNAME to the second-level domain name. Alternatively, you can add a second-level wildcard domain name to Alibaba Cloud CDN. 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 to Alibaba Cloud CDN.
      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 Alibaba Cloud CDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Click 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 domain 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, 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, 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. Second-level domain names cannot use the CNAME of the top-level domain name. If you want to accelerate a second-level domain name, add the second-level domain name to Alibaba Cloud CDN. Alibaba Cloud then assigns a CNAME to the second-level domain name. Alternatively, you can add a second-level wildcard domain name to Alibaba Cloud CDN. 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 to Alibaba Cloud CDN.
      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 Alibaba Cloud CDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.
    Click 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. Second-level domain names cannot use the CNAME of the top-level domain name. If you want to accelerate a second-level domain name, add the second-level domain name to Alibaba Cloud CDN. Alibaba Cloud then assigns a CNAME to the second-level domain name. Alternatively, you can add a second-level wildcard domain name to Alibaba Cloud CDN. 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 to Alibaba Cloud CDN.
      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 domain 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 *.exampl.
        • 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.
      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 Alibaba Cloud CDN console
    1. Log on to the Alibaba Cloud CDN 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 is the same as the CNAME that is assigned to the domain name, it indicates that CDN acceleration is enabled for the domain name. Check whether the CNAME record takes effect

What to do next

After you complete the preceding settings, you can configure features of Alibaba Cloud CDN for the domain name. For more information, see Features.