Modify DNS servers

Updated at:
Copy as MD

Modify the DNS server configuration for a domain name in the Alibaba Cloud Domains console. Changing DNS servers affects how your domain name resolves.

Before you begin

Synchronize your DNS records before modifying DNS servers to prevent service interruptions.

  1. Synchronize DNS records: Add your domain name in the target DNS provider's console and configure all DNS records.

  2. Verify DNS resolution: Query the new DNS server directly to confirm that it responds correctly.

    # Replace yourdomain with your domain name.
    # Replace ns1.alidns.com with the address of the target DNS provider's DNS server.
    dig @ns1.alidns.com yourdomain A
    dig @ns1.alidns.com yourdomain MX
  3. Disable DNSSEC if enabled

    If DNSSEC (Domain Name System Security Extensions) is enabled for your domain name, delete the DS record at your registrar and disable DNSSEC.

    # Use the dig command to check the DNSSEC status of your domain name.
    # If the response includes an RRSIG record, DNSSEC is enabled.
    dig +dnssec yourdomain.com
  4. (Recommended) Lower the TTL: Set the TTL of critical DNS records (A, MX) to 300–600 seconds at least 24–48 hours before the change. Wait for the old TTL cache to expire before proceeding.

Procedure

Modify DNS servers for a single domain

  1. Log on to the Domain Names page. Find the target domain name and click Manage in the Actions column.

  2. In the navigation pane on the left, click DNS Server Change.

  3. On the DNS Server Change page, click Change DNS Server.

  4. Enter the addresses of the target DNS servers and click Confirm.

Batch modify DNS servers for multiple domains

  1. Log on to the Domain Names page.

  2. In the navigation pane on the left, choose Batch Operations > Common Batch Operations > DNS Server Change.

  3. On the DNS Server Change page, enter the Domain Names and Custom DNS, submit the request, and then complete the email verification.

  4. On the details page of the Bulk Operations Log, check whether the operation was successful.

Verify the change

Run the following commands to monitor propagation after the change.

# Replace yourdomain with your domain name.
# 1. Check if the registry's NS records are updated to the new DNS server addresses.
dig yourdomain NS

# 2. Trace the full resolution path to confirm that requests are eventually answered by the new DNS servers.
dig +trace yourdomain A

Production environment considerations

  • Schedule this operation during off-peak hours and prepare a rollback plan.

  • DNS changes take effect based on the TTL of NS records cached by local resolvers. Full propagation can take 24–48 hours.

FAQ

What is a domain's DNS server?

A DNS server stores and manages DNS records for a domain name, including A records (IPv4), AAAA records (IPv6), MX records (mail servers), and CNAME records (aliases).

After registering a domain name, configure its DNS servers so other hosts can resolve the domain. You can use the registrar's default DNS servers or set up your own for more control.

For example, if you set the DNS servers for example.com to ns1.example.com and ns2.example.com, global resolvers query those servers for records of example.com and its subdomains such as www.example.com.

Important

Configure at least two DNS servers for redundancy. If one becomes unavailable, the other ensures continuous resolution.

Why can't I modify DNS servers?

If a domain name is in a grace period, redemption period, or transfer period, you cannot modify its DNS settings. Renew the domain name (Domain Name Renewal) or wait for the transfer to complete.

Why are DNS changes not taking effect?

Common causes:

  • Incorrect configuration on the new DNS servers: Verify that all required DNS records (A, CNAME, MX) are added in your new DNS provider's console.

  • Local DNS cache: Your regional or device DNS resolver may have cached old NS records. Propagation can take up to 48 hours. Try flushing your local DNS cache.

  • Self-hosted DNS issues: Verify that port 53 is open in the firewall, the DNS service is running, and the authoritative zone is configured correctly.

Can I use multiple DNS providers?

Yes. Domain names registered with Alibaba Cloud support DNS server addresses from multiple providers simultaneously.

Why do DNS modifications fail?

  • The specified DNS servers are invalid.

  • The domain name has a registrar lock, which prevents changes to DNS settings. You can perform a WHOIS query to check the domain name status. The query results show registrar lock for the Domain Name Status field.

    Solution:

    1. Log on to the Domain Names page. Find the target domain name and click Manage in the Actions column.

    2. In the navigation pane on the left, click Security Settings.

    3. Find the Update Lock setting, click Disable, and then complete the security verification as prompted.

How to find your local DNS server

The following steps are for Windows:

  1. Open Command Prompt by searching for "cmd" in the Start menu.

  2. Run ipconfig /all.

  3. Find the "DNS Servers" line in the output. The listed addresses are your DNS servers.

Clear your local DNS cache

To clear the local DNS cache on Windows:

  1. Open Command Prompt as an administrator. Search for "cmd" in the Start menu, right-click, and select "Run as administrator".

  2. Run ipconfig /flushdns.

  3. A message "Successfully flushed the DNS Resolver Cache" confirms the operation.