All Products
Search
Document Center

:How to resolve DNS record conflicts

Last Updated:Dec 01, 2025

When you add a DNS record, a "record conflict" error may prevent you from saving it. This error typically occurs because the CNAME record that you want to add conflicts with an existing record for the same host, such as an A record or an MX record.

Use case: switch from an A record to a CNAME record for acceleration

To minimize the impact on your services during the switch, perform this operation during off-peak hours.

Procedure

  1. In the Alibaba Cloud CDN console, add your domain name and configure its CNAME record. Ensure that the CNAME address is active.

  2. Lower the TTL of the existing A record.

    1. Log on to the Alibaba Cloud DNS console and navigate to the Settings page for the target domain name.

    2. Find the A record for the host, such as www. Change its TTL to the minimum value that your edition supports:

      • Personal Edition: 10 minutes.

      • Ultimate Edition: 60 seconds or less. For example, you can set the TTL to 10 seconds.

    3. Wait for a period equal to the original TTL value. For example, if the original TTL was 10 minutes, wait for at least 10 minutes. This ensures that DNS caches across the globe are updated with the new TTL.

  3. Switch to the CNAME record. Perform the following steps to minimize downtime.

    1. Delete the original A record.

    2. Add the CNAME record.

      Parameter

      Example value

      Description

      Record type

      CNAME

      Required

      Host

      www

      Same as the original record

      Record value

      example.cdn.aliyun.com.

      Copy this from the Alibaba Cloud CDN console. Do not omit the trailing dot (.).

      TTL

      Set to the value recommended by Alibaba Cloud CDN (usually 10 minutes).

      You can keep the default value.


Use case: use a root domain for both a website and an email service

To avoid a conflict between CNAME and MX records, you can use URL forwarding. This method redirects HTTP and HTTPS requests from the root domain to a subdomain, such as www, that is configured with a CNAME record.

Procedure

  1. Ensure that both the root domain (the source domain) and the www subdomain (the destination domain) have a valid Internet Content Provider (ICP) filing. This is a requirement for services hosted in mainland China.

  2. Add a CNAME record for the www subdomain. Set the value of the record to the address provided by Alibaba Cloud CDN, such as example.cdn.aliyun.com..

  3. Add an explicit URL forwarding record for the root domain (@). Set the destination to https://www.example.com.

  4. Retain the MX record for the root domain (@) to handle your email service.

Note

This solution applies only to web access. Other protocols, such as API calls or email client connections, cannot use URL forwarding to access the root domain.

Verify the configuration

After you change the DNS records, wait for the changes to propagate worldwide. You can then run the following commands to verify your configuration:

# Verify the CNAME record
dig www.example.com CNAME +short
# Expected output: example.cdn.aliyun.com.

# Verify the MX record
dig example.com MX +short
# Expected output: 10 your-mail-server.com.