CNAME configuration troubleshooting guide
This topic describes how to troubleshoot CNAME configuration and resolution anomalies.
Basic self-check: distinguish resolution anomalies from access anomalies
A CNAME (Canonical Name) record is an alias record in DNS resolution that maps one domain name to another domain name (the CNAME domain), which is then resolved to the IP address of the server to be accessed. If you have not configured a CNAME, obtain the CNAME address assigned to your accelerated domain name from the CDN console and configure the resolution record at your DNS provider. For information about how to obtain the address, configure the record, and understand DNS resolution principles, see Quick start to Alibaba Cloud CDN.
When the console status is abnormal or access fails, first query the DNS resolution result from the client network where the problem occurs. An independently added accelerated domain name should use its dedicated CNAME; a subdomain that is covered only by a wildcard configuration should use the CNAME assigned to that wildcard domain.
Windows query command
Open the Command Prompt, query the CNAME record of the accelerated domain name, and replace the placeholder with the actual domain name:
nslookup -type=CNAME <accelerated domain name>Linux or macOS query command
Open Terminal and use dig to query the accelerated domain name. Choose one of the following commands depending on whether you need to view the DNS response status:
Query only the CNAME target: Use it to compare the result with the expected address. If there is no output, switch to the detailed query.
dig +short <accelerated domain name> CNAMEView the DNS response status and answer: Use this to distinguish NXDOMAIN, no CNAME answer, and other DNS errors.
dig <accelerated domain name> CNAMECheck the status and ANSWER SECTION in the response.
Query result interpretation:
Confirm the response status and records: Check the
statusand theANSWER SECTIONin the DNS response to make sure valid resolution records are returned.Compare the query result: Match the returned full CNAME address against the expected address from the console. A result that merely contains the string
kunlunis not sufficient proof that the configuration is correct.For example, if the expected address is
cdn.example.com.w.alikunlun.com., the trailing dot (.) indicates a fully qualified domain name (FQDN) and is normal.A single successful CNAME match only means that the current Local DNS resolution is normal. Because DNS caches and application-layer paths vary by region, you must also verify business availability through actual HTTP/HTTPS requests. A
pingtest only reflects network-layer connectivity and cannot replace CNAME verification or application-layer probing.
Based on the DNS query and actual request results, continue troubleshooting and preserve evidence as follows:
CNAME result is inconsistent or empty:
First follow the CNAME resolution anomaly troubleshooting method to check the response status, authoritative records, and cache, and then verify the resolution line. An empty result may be caused by a resolution-chain anomaly and does not necessarily mean the domain is not connected to CDN.
If an independently added domain name still resolves to its wildcard CNAME, follow the exact-domain configuration not effective troubleshooting method.
CNAME is correct but access fails:
If there is no HTTP response, the failure may occur during the TLS handshake or certificate validation. Record the specific error from the browser or curl, and follow the HTTPS troubleshooting guide to troubleshoot.
If an HTTP response is returned, use the browser developer tools to view the actual HTTP status code, response headers, and error information, and compare them with the CDN and origin logs. If necessary, continue locating the specific cause by following the origin-fetch troubleshooting guide. A 5xx status code may be caused by the origin-fetch path or a gateway timeout, and you must check the logs to confirm whether the origin server itself is at fault.
Only some regions or clients experience anomalies:
Record the time, region, DNS resolver, resolution result, full URL, HTTP status code, response headers, and error information for both normal and abnormal requests. After comparing the differences and identifying the root cause (DNS, client, CDN configuration, or origin server), perform the fix. During troubleshooting, keep the existing public DNS configuration and domain enabled to avoid altering the failure state or causing secondary failures.