Support >
  About cybersecurity >
  How to configure domain name resolution after using CDN? Point the CNAME record to the CDN domain!

How to configure domain name resolution after using CDN? Point the CNAME record to the CDN domain!

Time : 2026-07-17 15:16:40
Edit : DNS.COM

  Connecting a domain to a CDN boils down to two steps: first, add the domain to the CDN, then modify a DNS record in the DNS management console. However, even this simple "modifying a DNS record" involves several intricacies, and can potentially cause website downtime. Today, we'll focus solely on this step—how ​​to point the CNAME record in your domain name resolution to the domain provided by the CDN.

  Many first-time CDN users instinctively search for the A record and IP address in their DNS settings. Then they find that the CDN console refuses to provide an IP address, only giving them a seemingly random domain name, such as www.example.com.w.kunlunsl.com.

  This isn't hard to understand. CDNs have hundreds or even thousands of nodes globally. Giving you a fixed IP address is no different from using the origin server directly. It's impossible to know how far the user is from that IP or how busy it is at the time. Therefore, the CDN provides a CNAME domain name, essentially an "entry point." When a user accesses your domain, the DNS will use the intelligent scheduling system behind this CNAME domain to immediately calculate and return the IP address of the node closest to the user with the lightest load.

  So, the core idea is simple: all you need to do is point your own accelerated domain to the dedicated domain assigned to you by the CDN via a CNAME record.

  Before you start, check your domain's current DNS records.

  Before adding a CNAME record, there's a pitfall you need to avoid. Check your DNS console to see if there are any A, MX, or TXT records under the subdomain you want to accelerate (e.g., www.example.com).

  CNAME records are mutually exclusive with most other record types under the same "Host Record" category. What does this mean? For example, if you already have an A record for www.example.com pointing to the server's IP address, and you want to add a CNAME record for www.example.com pointing to the CDN, the system will directly report an error, saying there's a conflict and it can't be added.

  At this point, you'll have to make a choice: delete or pause the original A record before adding the CNAME record. Many people hesitate at this point: will deleting the A record make the website inaccessible? As long as the CNAME record is configured correctly, user requests will be resolved to CDN nodes, which will then retrieve content from your origin server. This connection is functional, so there's no need to worry. However, as mentioned before, be cautious and back up the original record. Operate during off-peak hours, not during the midday heat. If the domain is already running online, to be on the safe side, you can first configure a CNAME record on a subdomain (e.g., test.example.com) to verify that the CDN is working properly before modifying the main domain.

  The main point: How to fill in the CNAME record

  Okay, now go to your domain's DNS management backend and find "DNS Settings" or "Add Record." How to fill it in depends on the situation:

  The first and most common situation: accelerating a subdomain, such as www.example.com

  Record type: Select CNAME. There are no other options.

  **Host Record:** Only enter the prefix "www," not the full domain name. Entering the full domain name will be incorrect, as the system won't recognize it.

  **Record Value/Record Value:** Paste the long domain name you copied from the CDN console. Make sure there are no spaces or missing characters.

  **TTL:** The default 600 seconds (10 minutes) is fine. TTL is the cache time of DNS records on DNS servers in various locations. Setting it shorter (e.g., 60 seconds) will make it take effect faster when switching back to the origin server, but will increase DNS query volume; setting it longer (e.g., 30 minutes) will reduce DNS resolution pressure, but will take longer for the changes to take effect. 10 minutes is a generally acceptable compromise.

  **Second method:** To speed up the root domain, i.e., example.com itself does not include "www."

  **Host Record:** Enter "@". However, there's something to note: configuring a CNAME record for the root domain may affect email reception. This is because the root domain's MX record (Mail Exchange Record) conflicts with the CNAME record. If your example.com is used to receive corporate emails, CNAMEting the root domain to the CDN may cause emails to be unreceived. Therefore, many CDN service providers recommend using subdomains (such as www) for acceleration, while the root domain should be handled by using an A record pointing to the origin server, or by using methods like "explicit URL forwarding" provided by the cloud service provider.

  The third method is wildcard domains, such as *.example.com.

  To accelerate all subdomains (a.example.com, b.example.com, etc.), one configuration is sufficient; simply enter * in the host record. Subdomains that haven't been individually configured with DNS will then use this CNAME record and automatically benefit from CDN acceleration. However, note that if you configure a different record for a subdomain (e.g., add an A record), that subdomain's DNS resolution will take priority and will not be affected by the wildcard domain.

  How to confirm if the configuration is effective?

  After filling in the records and clicking save, the CDN doesn't start working immediately. Because DNS has a cache, it takes time for the changes to take effect globally. This time is directly related to the TTL you just set. Generally, newly added records take effect faster, while modified records require waiting for the original record's TTL to expire.

  How to check if it's working? The most reliable way isn't to check the CDN console status (that update can be slow), but to check it manually:

  Windows users, open the command prompt (cmd) and type: `nslookup -qt=cname your_accelerated_domain_name`

  Mac/Linux users, open the terminal and type: `dig your_accelerated_domain_name`

  Check the returned results. See if the CNAME record value displayed in the ANSWER SECTION section matches the value you just copied and pasted from the CDN console. If they match exactly, congratulations, the configuration is working. Avoid using the ping command to verify, as ping returns the IP address of the A record, and many CDN nodes have restrictions or special handling for the ICMP protocol, so the result may not be accurate.

  If you wait a long time and still can't find it, or the console still shows "Pending Configuration," check if the host record was entered incorrectly (e.g., you entered the entire www.example.com), if the record value is missing characters, and if any conflicting A records were completely deleted. Additionally, if your CDN only has overseas acceleration enabled, the console may show that it is not configured when you verify it in a domestic network environment. However, this does not affect the actual access of overseas users, so don't worry about it.

DNS Amy
DNS Anna
DNS Luna
DNS NOC
Title
Email Address
Type
Information
Code
Submit