All Products
Search
Document Center

Dynamic Content Delivery Network:Add a CNAME record for a domain name

Last Updated:Feb 22, 2024

After you add a domain name to Dynamic Content Delivery Network (DCDN), the system assigns a CNAME record 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 points of presence (POPs). This enables content delivery acceleration, edge computing, and protection of web resources.

Background information

How it works

After you add a domain name to DCDN, the system assigns a CNAME to the domain name. You must map the accelerated domain name, such as example.aliyundoc.com, to the assigned CNAME such as example.aluyundoc.com.w.cdngslb.com. This way, client requests can be forwarded to DCDN POPs to accelerate content delivery.

Domain name resolution

Domain name resolution is the process of converting a domain name, such as example.aliyundoc.com, into an IP address of the client. For more information, see What is DNS resolution?

Prerequisites

A domain name is added by following instructions in Add a domain name.

Step 1: Obtain the CNAME of the accelerated domain name

Go to the Domain Names page in the DCDN console and copy the CNAME record of the accelerated domain name. 1

Step 2: Add a CNAME record

Different DNS service providers have different methods to add CNAME records.

Important
  • Make sure that the DNS records do not conflict with each other in the same system.

  • The server that DCDN uses for domain name resolution is deployed in the Chinese mainland. If you configure region-specific DNS settings for your domain name, for example, you add a CNAME record for your DCDN-accelerated domain name only in regions outside the Chinese mainland, including Hong Kong (China), Macao (China), and Taiwan (China), the domain name cannot be mapped to the CNAME. The CNAME status is Pending Configuration in the DCDN console. However, acceleration for the domain name is not affected.

  • CNAMEs that are assigned by Alibaba Cloud CDN, DCDN, ApsaraVideo Live, and ApsaraVideo VOD can be used only for domain name resolution. If Alibaba Cloud detects that your CNAME is used for unauthorized or malicious activities, Alibaba Cloud reserves the right to close your Alibaba Cloud account and remove the domain 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 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 with Alibaba Cloud.

    Note

    If the domain name is not registered with Alibaba Cloud, you need to add the domain name to Alibaba Cloud DNS before you can add a DNS record for it. For more information, see Manage domain names. If the domain name is registered with Alibaba Cloud, skip this step.

  3. On the Domain Name Resolution page, find your domain name and click DNS Settings in the Actions column.

  4. Click Add DNS Record to add a record.

    Note

    The CNAME record of a specific domain name takes precedence over that of a wildcard domain name. If you want to accelerate a wildcard domain, where the DNS record contains an asterisk (*), you need to delete all other DNS records that match the wildcard domain.

    添加记录

    Parameter

    Description

    Example

    Record Type

    Select CNAME from the drop-down list.

    CNAME

    Hostname

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    For more information about subdomains, see Basic concepts.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    DNS Request Source

    Select Default from the drop-down list.

    We recommend that you keep the default setting.

    Record Value

    Enter the CNAME of the domain name.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains 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 Period

    Enter a time-to-live (TTL) value for the record. A smaller value indicates that the record is updated quicker. The default TTL value is 10 minutes.

    We recommend that you keep the default setting.

  5. Click OK.

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 DNSPod console.

  2. On the DNSPod page, click Add Records to add a CNAME record.

    Parameter

    Description

    Example

    Hostname

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    For more information about subdomains, see Basic concepts.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Record Type

    Select CNAME from the drop-down list.

    CNAME

    Split Zone

    Select Default.

    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. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains 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 that the record is updated quicker.

    We recommend that you keep the default setting.

  3. Click Confirm.

Step 3: Verify that the CNAME record takes effect

  • Method 1: Use the DCDN console

    1. Log on to the DCDN console and navigate to the Domain Names page.

    2. Find the domain name and move the pointer over the CNAME Status column. If the CNAME status is Configured, the CNAME has taken effect.

  • Method 2: Run the nslookup command

    1. Start Command Prompt in Windows or Terminal in macOS or Linux.

    2. Run the nslookup -type=CNAME domainName command. If the CNAME record in the output is the same as the CNAME record that is assigned to the domain name in the DCDN console, DCDN acceleration takes effect for the domain name.image.png

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 POPs during off-peak hours. This increases the cache hit ratio. For more information, see Refresh and prefetch resources.