All Products
Search
Document Center

Alibaba Cloud DNS:Intelligent DNS resolution

Last Updated:Jan 24, 2024

This topic describes how to configure intelligent Domain Name System (DNS) resolution based on the geographic locations or Internet service providers (ISPs) of visitors. In this way, the requests of the visitors can be routed to the nearest servers.

Overview

In traditional DNS resolution, IP addresses of website servers are randomly returned to visitors regardless of the DNS request sources of the visitors. In intelligent DNS resolution, specified IP addresses of website servers are returned to visitors based on the DNS request sources of the visitors. This reduces resolution latency and accelerates website access.

Example of traditional DNS resolution

For example, the domain name www.cloud-example.com is hosted by three servers. The IP addresses of these servers are provided by China Unicom, China Mobile, and China Telecom. You can configure the following DNS settings:

  • Point the domain name to the IP address 192.x.x.1 provided by China Unicom.

  • Point the domain name to the IP address 192.x.x.2 provided by China Mobile.

  • Point the domain name to the IP address 192.x.x.3 provided by China Telecom.

Effect of the configurations:

The three IP addresses 192.x.x.1, 192.x.x.2, and 192.x.x.3 are returned to the local DNS server of a visitor regardless of the DNS request source of the visitor. The local DNS server then randomly returns one of the IP addresses to the visitor or returns an IP address to the visitor based on the preset priority. This may cause cross-network access.

Example of intelligent DNS resolution

For example, the domain name www.cloud-example.com is hosted by three servers. The IP addresses of these servers are provided by China Unicom, China Mobile, and China Telecom. You can configure the following DNS settings:

  • Set the DNS Request Source parameter to Default and point the domain name to the IP address 192.x.x.1 provided by China Unicom.

  • Set the DNS Request Source parameter to China Mobile and point the domain name to the IP address 192.x.x.2 provided by China Mobile.

  • Set the DNS Request Source parameter to China Telecom and point the domain name to the IP address 192.x.x.3 provided by China Telecom.

Effect of the configurations:

Alibaba Cloud DNS returns an IP address based on the DNS request source of a visitor.

  • If the DNS request source of the visitor is China Mobile, Alibaba Cloud DNS returns 192.x.x.2.

  • If the DNS request source of the visitor is China Telecom, Alibaba Cloud DNS returns 192.x.x.3.

  • If the DNS request source of the visitor is neither China Mobile nor China Telecom, Alibaba Cloud DNS returns 192.x.x.1.

How it works

Alibaba Cloud DNS determines the DNS request source of a visitor by identifying the egress IP address of the local DNS server.

The local DNS server supports Extension Mechanisms for DNS (EDNS)

Because Alibaba Cloud DNS supports EDNS Client Subnet (ECS), it preferentially attempts to obtain the IP address carried in the ECS extension as the source IP address of the visitor. If the ECS extension carries an IP address, Alibaba Cloud DNS determines the geographic location of the visitor based on this IP address. If the ECS extension does not carry an IP address, Alibaba Cloud DNS determines the geographic location of the visitor based on the egress IP address of the local DNS server.

The local DNS server does not support EDNS

The local DNS server sends the iterative DNS request to Alibaba Cloud DNS. Alibaba Cloud DNS then determines the geographic location of the visitor based on the egress IP address of the local DNS server to achieve intelligent DNS resolution.

The local DNS server conditionally supports EDNS

The DNS request initiated by the visitor is sent to the local DNS server. The local DNS server sends the request to the level 2 node. The level 2 node sends the request to Alibaba Cloud DNS. Then, Alibaba Cloud DNS returns a specific resolution result based on the geographic location of the level 2 node.

image

Procedure

Scenario 1: Intelligent DNS resolution based on ISP lines

1. Log on to the Alibaba Cloud DNS console.

2. On the Authoritative Domain Names tab of the Domain Name Resolution page, find the desired domain name and click DNS Settings in the Actions column.

3. On the DNS Settings page, click Add DNS Record.

Example:

If you want to point the domain name www.cloud-example.com to three IP addresses that are respectively provided by China Telecom, China Unicom, and China Mobile, specify the DNS Request Source parameter according to the following settings:

  • Set the DNS Request Source parameter to Default and set the Record Value parameter to the IP address 192.168.0.1 provided by China Unicom.

  • Set the DNS Request Source parameter to China Mobile and set the Record Value parameter to the IP address 192.168.0.2 provided by China Mobile.

  • Set the DNS Request Source parameter to China Telecom and set the Record Value parameter to the IP address 192.168.0.3 provided by China Telecom.

image.png

Expected results

  • If the DNS request source of a visitor is neither China Telecom nor China Mobile, Alibaba Cloud DNS returns the IP address 192.168.0.1.

  • If the DNS request source of a visitor is China Mobile, Alibaba Cloud DNS returns the IP address 192.168.0.2.

  • If the DNS request source of a visitor is China Telecom, Alibaba Cloud DNS returns the IP address 192.168.0.3.

Scenario 2: Intelligent DNS resolution based on regional lines

  1. Log on to the Alibaba Cloud DNS console.

  2. On the Authoritative Domain Names tab of the Domain Name Resolution page, find the desired domain name and click DNS Settings in the Actions column.

  3. On the DNS Settings page, click the Switch Line Type tab and switch ISP lines to regional lines. For more information, see Switch lines.

    Important

    You can switch lines only after you purchase an Alibaba Cloud DNS instance of Enterprise Standard Edition or Enterprise Ultimate Edition. You can upgrade your instance if your instance does not support this feature.

  4. On the DNS Settings page, click Add DNS Record.

Example:

If you want to point the domain name test.cloud-example.com to three IP addresses that are located in Zhejiang, Guangdong, and Beijing, specify the DNS Request Source parameter according to the following settings:

  • Set the DNS Request Source parameter to Default and set the Record Value parameter to the IP address 192.168.0.7 located in Zhejiang.

  • Set the DNS Request Source parameter to South China and set the Record Value parameter to the IP address 192.168.0.8 located in Guangdong.

  • Set the DNS Request Source parameter to North China and set the Record Value parameter to the IP address 192.168.0.9 located in Beijing.

image.png

Expected results

  • If the DNS request source of a visitor is neither North China nor South China, Alibaba Cloud DNS returns the IP address 192.168.0.7.

  • If the DNS request source of a visitor is South China, Alibaba Cloud DNS returns the IP address 192.168.0.8.

  • If the DNS request source of a visitor is North China, Alibaba Cloud DNS returns the IP address 192.168.0.9.

Supported intelligent resolution lines

For more information about the intelligent resolution lines that can be identified by Alibaba Cloud DNS, see DNS resolution lines.