This topic describes how to configure a CNAME record for an accelerated domain name in Alibaba Cloud CDN. This final step activates the CDN service by routing user requests to the nearest point of presence (POP), which enables global content distribution and access acceleration.
How it works
A CNAME record, or Canonical Name record, is a type of DNS record that maps one domain name to another. The process is as follows:
When a user visits
www.example.com, their local DNS resolver queries the public DNS system for the IP address ofwww.example.com.Alibaba Cloud DNS queries the DNS records of
www.example.comand finds a CNAME record that points towww.example.com.w.kunlunsl.com.Alibaba Cloud DNS then queries for the A record (IP address) of
www.example.com.w.kunlunsl.com.The CDN's DNS scheduling system receives the resolution request and dynamically returns the IP address of the optimal point of presence (POP) based on the user's location, network conditions, and POP load.
The user connects to the POP using the returned IP address to retrieve the requested content. The POP then serves the content from its cache or fetches it from the origin server.
Prerequisites
You have activated the service. If not, see Activate DCDN first.
You have added an accelerated domain name. If not, see Add an accelerated domain name.
Usage notes
If the accelerated domain name is already in use, first test the CNAME record mapping to prevent service disruptions. After successful verification, back up the original record and replace it with the CNAME record during off-peak hours.
CNAMEs assigned by Alibaba Cloud CDN, DCDN, ApsaraVideo Live, and ApsaraVideo VOD can be used only for Alibaba Cloud service scheduling and resolution. Alibaba Cloud reserves the right to disable any domain name and account that uses these CNAMEs for malicious activities.
Step 1: Get the CNAME of the accelerated domain
In the Alibaba Cloud CDN console, go to the Domain Names page and copy the CNAME for your accelerated domain name.

If the CNAME is not displayed after you add the domain name, wait 1 to 5 minutes and refresh the page. The system needs this time to generate it.
Step 2: Configure a CNAME record
For the same host record, a CNAME record conflicts with other record types, such as A, AAAA, MX, and TXT records. Before you add a CNAME record, you must delete any existing conflicting records for that host record. Otherwise, you cannot add the CNAME record or domain name resolution will fail. For more information about conflicts and solutions, see Rules for DNS record conflicts.
Log on to the Alibaba Cloud DNS console by using the Alibaba Cloud account to which the accelerated domain name belongs.
On the Public Zone page, find your domain name, and click DNS Settings in the Actions column.
Click Add Record. Configure the record based on one of the following scenarios:
Scenario 1: Subdomain (recommended)
This is the most common scenario. For example, you can configure an accelerated domain name such as www.example.com and use it to accelerate access to your origin server.
Parameter | Value | Description |
Record Type |
| Set the value to |
Host record |
| Enter the prefix of the subdomain. |
TTL | 10 minutes (recommended) | The cache duration of the DNS record. You can change the value based on your business requirements. |
Record Value | Paste the CNAME that you obtained in Step 1. | Ensure that the address is complete and unmodified. |
Scenario 2: Root domain (for example, example.com)
Configuring a CNAME record for a root domain may conflict with its MX record (mail server address) and cause email delivery failure. If your root domain hosts critical services such as email, authentication, or security policies, use a subdomain as the accelerated domain name, as described in Scenario 1.
Parameter | Value | Description |
Record Type |
| Set the value to |
Host record |
| If you use a root domain as the accelerated domain name, set the host record to |
TTL | 10 minutes (recommended) | The cache duration of the DNS record. You can change the value based on your business requirements. |
Record Value | Paste the CNAME that you obtained in Step 1. | Ensure that the address is complete and unmodified. |
Scenario 3: Wildcard domain name (for example, *.example.com)
Wildcard domain name resolution directs requests for all undefined subdomains to CDN. For example, if you configure *.example.com as the accelerated domain name, requests for subdomains such as cdn.example.com and test.example.com are accelerated, and both can be used to access resources on the origin server. For more information, see Accelerate wildcard domain names.
Parameter | Value | Description |
Record Type |
| Set the value to |
Host record |
| If you use a wildcard domain name as the accelerated domain name, set the host record to |
TTL | 10 minutes (recommended) | The cache duration of the DNS record. You can change the value based on your business requirements. |
Record Value | Paste the CNAME that you obtained in Step 1. | Ensure that the address is complete and unmodified. |
Click OK to add the record.
Step 3: Verify the CNAME configuration
The servers that Alibaba Cloud uses to verify DNS records are deployed in the Chinese mainland. If you configure region-based DNS resolution to use the CNAME address of your Alibaba Cloud service only in regions outside the Chinese mainland, such as Hong Kong (China), Macao (China), Taiwan (China), and other countries and regions, the verification servers cannot resolve the CNAME address. In this case, the CNAME status of the domain name is displayed as To Be Configured in the console. This does not affect the acceleration service.
Method 1: Check the status in the DCDN console
Go to the Domain Names page in the Alibaba Cloud DCDN console.
Find the target domain name. Hover the pointer over the CNAME status. If the status is Configured, the CNAME record has taken effect.
NoteA new CNAME record added in Alibaba Cloud DNS takes effect immediately. A modified CNAME record takes effect after its TTL expires. The default TTL is 10 minutes. During this period, the status may still be displayed as To Be Configured in the console. You can ignore this status.
Method 2: Verify using the nslookup command
Open Command Prompt in Windows or Terminal in macOS or Linux.
Run the nslookup -type=CNAME accelerated domain name command. If the output matches the CNAME provided in the console for the accelerated domain name, the acceleration service is active. For example:
nslookup -type=CNAME www.example.com