CNAME configuration FAQ

更新时间:
复制 MD 格式

CDN assigns a CNAME address to each accelerated domain name. Point your domain's DNS record to this CNAME address to activate CDN acceleration. The following sections cover common questions about CNAME configuration.

Verify CNAME record status

After you configure the CNAME record in the CDN console, verify it with nslookup or dig. Avoid the ping command because it may return inaccurate DNS results.

Windows

nslookup -type=CNAME <accelerated domain name>

If the returned result matches the CNAME address assigned by CDN, the CNAME record has taken effect.

Linux/macOS

On Linux or macOS, run dig to verify the configuration:

  • Query only the CNAME target address (recommended):

    dig +short <accelerated domain name> CNAME

    If the result matches the CNAME address assigned by CDN, the CNAME record has taken effect. Example output:

    dig +short cdn.example.com CNAME
    cdn.example.com.w.alikunlun.com.
  • Query detailed domain name information:

    dig <accelerated domain name> CNAME

    If the CNAME value in the ANSWER SECTION matches the CNAME address assigned by CDN, the CNAME record has taken effect.

Troubleshoot  NXDOMAIN  or "record not found" errors

Follow these steps to troubleshoot:

  1. Verify the domain name spelling: Make sure the domain name entered in the command is correct.

  2. Check the DNS configuration: Log on to the DNS console and verify that the CNAME record exists and the host record is correct. The host record must be the prefix of the accelerated domain name, not the full domain name. For example, if your accelerated domain name is cdn.example.com, the host record should be cdn, not cdn.example.com.

  3. Wait for DNS propagation: After you modify a DNS record, the change takes time to propagate globally. Wait a few minutes and try again.

    Note

    DNS propagation time depends on the Time to Live (TTL) of the record. For example, if the previous record had a TTL of 10 minutes, the new record takes at least 10 minutes to take effect. Before you modify a CNAME record, we recommend setting the TTL of the original record to a shorter value, such as 60 seconds.

Resolve A record conflicts

An A record and a CNAME record cannot coexist for the same host record. If a conflict error appears, another record type already exists for that host record. To resolve this:

  1. Log on to the DNS console and find the conflicting A record (or MX, TXT, or other record types).

  2. Delete or pause the conflicting record.

  3. Add the CNAME record again and set the record value to the CNAME address assigned by CDN.

Note
  • Deleting the A record interrupts traffic to the origin server. Test with a subdomain first to verify that CDN acceleration works before switching your primary domain.

  • Perform this operation during off-peak hours.

  • If you enabled health checks in Global Traffic Manager (GTM), GTM might automatically create a conflicting DNS record. Resolve the issue in GTM before adding the CNAME record.

Troubleshoot incorrect console status

CNAME configuration typically takes 5 to 30 minutes to take effect, depending on the DNS record TTL. After global propagation, the CDN console updates the domain status to active. Refresh the page after a few minutes.

If the domain status does not update after a reasonable time, troubleshoot as follows:

  1. Check if the host record is correct: The host record must match the prefix of your accelerated domain name. For example, the host record for a.example.com is a, and the host record for example.com is @. A common mistake is entering www when the accelerated domain name is not www.example.com.

  2. Check if the CNAME record value is correct: The record value must exactly match the CNAME address displayed in the CDN console. We recommend copying the address directly from the console.

  3. Verify with nslookup or dig: Confirm that the returned CNAME points to the address assigned by CDN.

  4. Check for conflicting records: Ensure that you have deleted the A record or other conflicting records for the same host record.

Handle "CNAME not configured" status mismatch

In the following scenarios, the CDN console may report the CNAME as not configured even though acceleration works correctly. This does not affect your service:

  • The acceleration region excludes the Chinese mainland: If you set the acceleration region to Global (excluding the Chinese mainland) (which corresponds to the Scope API parameter being set to overseas), a CNAME check from within the Chinese mainland may incorrectly report that the CNAME is not configured. This is expected and does not affect your service in the target region. To verify that acceleration is active outside the Chinese mainland:

    1. Use the nslookup or dig command, or check in the CDN console to confirm that the domain name resolves to the CNAME address assigned by CDN.

    2. Access the accelerated resource from a network outside the Chinese mainland, then use your browser's developer tools to check the response header. An X-Cache value of HIT confirms that acceleration is working.

  • Split-horizon DNS is configured: If your DNS provider returns different records for different regions, such as pointing Chinese mainland traffic to the CDN CNAME address and other traffic to the origin IP, the console may report "CNAME not configured" because not all regions resolve to CDN. You can ignore this message if users in the target regions can access accelerated resources correctly.

  • DNS propagation delay: After you add or modify a CNAME record, global DNS propagation can take from several minutes to several hours, depending on the TTL setting. The console may show "CNAME not configured" during this period. Check again later.

Multiple CNAME records for a single domain

No. Only one CNAME record value is allowed per host record. Multiple CNAME records can cause access errors, such as HTTP 403.

Solution: Keep only one CNAME record for the host record, pointing to the CNAME address assigned to your accelerated domain name. Delete any extra records.

Wildcard CNAME records and subdomains

After you configure a CNAME record for a wildcard domain such as *.example.com, all subdomains without their own DNS records (for example, a.example.com and b.example.com) inherit the wildcard record. To exclude specific subdomains from CDN acceleration, configure a separate A record or another record type for them. A specific DNS record for a subdomain takes precedence over the wildcard record.

Note

Resolution precedence rules may vary by DNS provider.