Configure intelligent DNS resolution
Use cases
Intelligent DNS resolution applies to the following use cases:
-
Route traffic for cross-carrier or cross-region access within the Chinese mainland: Most online applications use IP addresses from multiple carriers. Traditional DNS resolution returns one of these IP addresses randomly or based on simple rules, which can cause slow speeds or poor quality for users on different networks or in different regions. Intelligent DNS resolution routes users to the nearest access point.
-
Route traffic for global services: For global businesses, application services are typically deployed in different regions, such as within and outside the Chinese mainland, to ensure a high-quality experience for all users. Intelligent DNS resolution routes user requests to the appropriate access point based on their location.
-
Block access from specific regions or carriers: To prevent users in certain regions or on certain networks from accessing your services, intelligent DNS resolution can block their requests.
Prerequisites
For cross-carrier or cross-region access within the Chinese mainland
-
A domain name for user access, such as example.com. The examples in this topic use Alibaba Cloud DNS Ultimate Edition.
-
Three IP addresses from different carriers: 1.1.XX.XX (China Unicom), 2.2.XX.XX (China Mobile), and 3.3.XX.XX (China Telecom).
For global services
-
A domain name for user access, such as example.com. The examples in this topic use Alibaba Cloud DNS Ultimate Edition.
-
Two server IP addresses: 1.1.XX.XX (outside the Chinese mainland) and 2.2.XX.XX (from China Telecom).
To block access from specific regions or carriers
-
A domain name for user access, such as example.com. The examples in this topic use Alibaba Cloud DNS Ultimate Edition.
-
One server IP address: 2.2.XX.XX (from China Telecom).
Procedure
Route traffic for cross-carrier or cross-region access
Expected behavior: Alibaba Cloud DNS determines the source of each DNS query and returns the corresponding IP address.
-
If a DNS query comes from a local DNS egress IP address of China Mobile, it is resolved to 2.2.XX.XX.
-
If a DNS query comes from a local DNS egress IP address of China Telecom, it is resolved to 3.3.XX.XX.
-
If a DNS query comes from a local DNS egress IP address that does not belong to China Mobile or China Telecom (for example, from Dr. Peng or China Unicom), it is resolved to 1.1.XX.XX.
Steps
-
On the Alibaba Cloud DNS - Authoritative Domain Names page, click the target domain name to go to the Settings page.
-
Click Add Record. Create records for the subdomain
test.example.comto point to three carrier IP addresses: 1.1.XX.XX (China Unicom), 2.2.XX.XX (China Mobile), and 3.3.XX.XX (China Telecom). For the records, set Query Source to Default, China Mobile, and China Telecom, respectively.
Route traffic for global services
Expected behavior:
-
If a DNS query comes from a local DNS egress IP address outside the Chinese mainland, it is resolved to the overseas IP address 1.1.XX.XX.
-
If a DNS query comes from a local DNS egress IP address within the Chinese mainland, it is resolved to the China Telecom IP address 2.2.XX.XX.
Resulting configuration
After the configuration is complete, the DNS record list displays two A records:
-
Hostname test, resolution source: Overseas, record value: IP address of the overseas server, TTL: 1 second, status: enabled.
-
Hostname test, resolution source: Default, record value: IP address of the default server, TTL: 1 second, status: enabled.
Block access from specific regions or carriers
Expected behavior:
-
If a DNS query comes from a local DNS egress IP address outside the Chinese mainland, it is resolved to 127.0.0.1. This blocks users outside the Chinese mainland from accessing the service.
-
If a DNS query comes from a local DNS egress IP address within the Chinese mainland, it is resolved to the China Telecom IP address 2.2.XX.XX.
Resulting configuration
After the configuration is complete, the DNS record list displays two records:
-
Hostname test, type A, resolution source: Overseas, record value:
127.0.0.1, TTL: 1 second, status: enabled. -
Hostname test, type A, resolution source: Default, record value:
2.2.x.x, TTL: 1 second, status: enabled.