Custom DNS Host

更新时间:
复制 MD 格式

If the hostname of your self-managed DNS server is a subdomain of the domain it serves, create a custom DNS host in the Alibaba Cloud Domain Names console. This process registers the hostname and its IP address with the TLD registry to break a circular dependency and ensure your domain resolves correctly.

Use cases

Create a custom DNS host if you use a self-managed authoritative name server and its hostname is a subdomain of the domain it hosts. This registers a glue record with the TLD registry. The glue record provides the IP address of your DNS server, which breaks a circular dependency during DNS lookups and ensures your domain resolves correctly.

For example, if ns1.example.com is the DNS server for example.com, when a resolver tries to find the IP address of ns1.example.com, it must first query the authoritative name servers for example.com. However, that server is ns1.example.com itself, which creates a circular dependency. A glue record breaks this loop by providing the IP address of ns1.example.com directly at the registry.
Important

Creating a custom DNS host is an advanced feature. If you lack experience managing DNS servers or want to avoid the maintenance costs and security risks, we strongly recommend using a managed DNS service provided by a cloud provider such as Alibaba Cloud. An incorrect configuration can cause your domain's DNS resolution to fail, making your website, email, and all related services inaccessible.

Procedure

Step 1: Create a custom DNS host

Note
  • You can create a maximum of 13 custom DNS hosts for a domain. The exact limit depends on the rules of the TLD registry.

  • The custom DNS host feature is not supported for .hk domains.

  • For .cn domains, you cannot use a fourth-level domain as a DNS server name, and you can create a maximum of 6 custom DNS hosts.

  1. Log on to the Alibaba Cloud Domain Names console. On the Domain Names page, find the domain and click Manage in the Actions column.

  2. In the left-side navigation pane, choose DNS Management > DNS Host, and then click Create DNS Server.

  3. Enter the DNS Server name and ip address. Then, click OK.

    • DNS Server: Enter the hostname, for example, ns1.

    • ip address: The public IP address of your self-managed DNS server, for example, 192.0.2.1. You must specify at least 1 and up to 13 IP addresses for each DNS host. The exact limit depends on the rules of the TLD registry.

Step 2: Add a DNS record

To activate the custom DNS host, add a corresponding A record (for IPv4) or AAAA record (for IPv6) at your domain's DNS provider. The record's value must be the IP address of the custom DNS host server.

If your domain uses Alibaba Cloud DNS, follow these steps:

  1. Log on to the Alibaba Cloud DNS console. On the Public Zone page, click the target domain to open the Settings page.

  2. On the Settings page, click Add Record. In the Add Record panel, configure the following parameters:

    • Record Type: Select A for an IPv4 address or AAAA for an IPv6 address.

    • Hostname: The DNS server name that you created in Step 1, for example, ns1.

    • Record Value: The public IP address of your self-managed DNS server, for example, 192.0.2.1.

For more information, see Add DNS Records.

Step 3: Configure records on your DNS server

On your self-managed DNS server, follow the instructions for your DNS software to configure all required DNS records. Ensure that the server can correctly respond to queries for its own hostname and for the domains it hosts.

Step 4: Change the domain's DNS servers

This step points your domain's DNS queries to your self-managed DNS server. To prevent service interruptions for your website, email, and other services during the switch, migrate all DNS records from your previous DNS provider to your self-managed DNS server (complete Step 3) before you proceed with this step.

  1. In the Alibaba Cloud Domain Names console, find the target domain on the Domain Names list and go to its Manage page.

  2. In the left-side navigation pane, choose DNS Management > DNS Server Change.

  3. Click Change DNS Server.

  4. In the provided fields, enter the full hostnames of the DNS servers you created in Step 1, for example, ns1.example.com and ns2.example.com.

  5. Click OK. This change takes 24 to 48 hours to propagate across the internet.

For more information, see Change DNS Servers.

FAQ

What is a self-managed DNS server?

A self-managed DNS server is an authoritative name server that you deploy and maintain yourself, instead of using a managed DNS service from a domain provider. Operating a self-managed DNS server requires professional technical skills. If you do not have relevant experience, we recommend using a managed service like Alibaba Cloud DNS to avoid service disruptions caused by misconfiguration.

What is a custom DNS host?

A custom DNS host is Alibaba Cloud's implementation of a glue record. When the hostname of an authoritative name server is a subdomain of the domain itself, DNS resolution can fall into a circular dependency. A glue record breaks the loop by providing the IP address (as an A or AAAA record) of that name server directly at the TLD registry, ensuring resolution can proceed.

For example, if the authoritative name server for example.com is ns1.example.com, a resolver must first query the IP address of ns1.example.com. But the authoritative name server for example.com is ns1.example.com itself. This creates a loop. A glue record resolves this by storing the IP address of ns1.example.com directly at the registry.

How are DNS glue records represented?

A custom DNS host is the term used on Alibaba Cloud for a glue record. It consists of NS records and their corresponding A/AAAA records. In a zone file, it is represented as follows:

@                 IN NS dns1.example.com.
@                 IN NS dns2.example.com.
dns1.example.com. IN A 192.168.1.1
dns2.example.com. IN A 192.168.2.1

How do I fill in the server name?

When you create the custom DNS host, enter only the subdomain part, for example, ns1. When you change the domain's DNS servers, you must enter the full hostname, for example, ns1.example.com.

Note

For .cn domains, you cannot use a fourth-level domain as a DNS server name.

How many DNS servers can I create?

You can create a maximum of 13 DNS servers. The exact limit is determined by the rules of the TLD registry.

Do custom DNS hosts support IPv6 addresses?

Yes. You can enter an IPv6 address when you create a custom DNS host. You must also add a corresponding AAAA record (instead of an A record) in your domain's DNS settings.

How many IP addresses are supported?

Each DNS server must have at least 1 IP address and can have a maximum of 13. The exact limit is determined by the rules of the TLD registry.

Note
  • For .cn domains, you can create a maximum of 6 custom DNS hosts.

  • The custom DNS host feature is not supported for .hk domains.

Can the server name be modified or deleted?

Yes, but this is a high-risk operation. Before you make changes, first update the configuration on your self-managed DNS server. Plan the change process carefully and create backups to avoid service interruptions.

Can the IP address be modified or deleted?

Yes, but you must keep at least one IP address.

Does a custom DNS host take effect immediately?

Creating a custom DNS host at the registry usually takes effect within a few minutes. However, if you also change your domain's DNS servers to point to the new host, that change takes 24 to 48 hours to propagate globally.

Can a custom DNS host be deleted?

Yes. Before deleting, ensure that you have changed the domain's DNS servers to other valid DNS servers. Otherwise, the domain will become unresolvable.