All Products
Search
Document Center

Intelligent DNS resolution and failover

Last Updated: Aug 27, 2020

Scenario

In most cases, enterprises deploy their applications on multiple servers, whose IP addresses may come from data centers of different countries, regions, carriers, or service providers. You can use intelligent DNS resolution to route visitors to the nearest application servers to accelerate access. However, a DNS server cannot detect the availability of application servers. When an application server becomes faulty in case of disasters, the DNS server may still return the IP address of the faulty server to visitors. As a result, the visitors fail to access the application.

Solutions

  • Configure intelligent DNS resolution to route visitors to the nearest application servers to accelerate access.
  • Configure the health check feature in Global Traffic Manager to implement failover and redundancy.

This topic describes how to configure intelligent DNS resolution and failover by using Alibaba Cloud DNS.

Example

Deployed application serves

  • Beijing: 1.1.1.1 and 2.2.2.2
  • Shanghai: 3.3.3.3 and 4.4.4.4
  • Japan: 10.10.10.10 and 12.12.12.12
  • Germany: 13.13.13.13 and 14.14.14.14
  • Singapore: 7.7.7.7 and 8.8.8.8

Intelligent DNS resolution

  • Visitors from China are routed to the servers in Beijing (1.1.1.1 and 2.2.2.2).
  • Visitors from Japan are routed to the servers in Japan (10.10.10.10 and 12.12.12.12).
  • Visitors from Europe are routed to the servers in Germany (13.13.13.13 and 14.14.14.14)

Failover

  • Failover between servers in Beijing and Shanghai
  • Failover between servers in Japan and Singapore
  • Failover between servers in Germany and Singapore

For example, if the application servers in Beijing are faulty, access traffic to Beijing are forwarded to Shanghai. This ensures that your business is not interrupted.

Preparations

Prepare a domain name

This topic uses the domain name api.dns-example.com as an example.

Purchase Alibaba Cloud DNS

In the configuration, fine-grained intelligent DNS resolution is used. You need to purchase the Enterprise Standard or Enterprise Ultimate edition of Alibaba Cloud DNS. For resolution lines supported by the Enterprise Standard Edition, see Supported lines.

Purchase the Enterprise Standard Edition of Alibaba Cloud DNS.

Configure Global Traffic Manager

For example, you provide the same subdomain to users from different regions. You can determine how many Global Traffic Manager instances you need to purchase based on the number of intelligent DNS records. This example specifies that different IP addresses are returned to visitors from China, Japan, and Europe. This requires three DNS records. Therefore, you must purchase three Global Traffic Manager instances.

Purchase Global Traffic Manager instances.

Procedure

Global Traffic Manager

1. Log on to the Alibaba Cloud DNS console.

2. On the Global Traffic Manager page, create the instances and configure the primary domain name.

  • Choose Global Traffic Manager and click Configure.

gtm-1

  • On the Global Settings tab, configure the instance names, such as test (China), test (Japan), and test (Europe). Set the primary domains in all the three instances to api.dns-example.com.


gtm-2

gtm-3

3. Configure the test (China) instance.

  • On the Address Pool Configurations tab, click Create Address Pool to create the Beijing and Shanghai address pools.

gtm-4

  • Global Traffic Manager uses health checks to implement failover. You must enable Health Check and add a new health check or click Edit to modify an existing health check. For more information, see Health check.

gtm-5

gtm-6

  • On the Access Policy tab, click Add Access Policy. Set the Default Address Pool to Beijing and Alternative Address Pool to Shanghai.

  • Set DNS Request Source to Global. Global Traffic Manager only supports part of the resolution lines. You can set DNS Request Source to Global and configure fine-grained intelligent DNS resolution on the Manage DNS page.

gtm-7

4. Configure the test (Japan) instance.

  • On the Address Pool Configurations tab, click Create Address Pool to create the Japan and Singapore address pools and enable Health Check.

gtm-11

  • On the Access Policy tab, click Add Access Policy. Set the Default Address Pool to Japan and Alternative Address Pool to Singapore.

  • Set DNS Request Source to Global. Global Traffic Manager only supports part of the resolution lines. You can set DNS Request Source to Global and configure fine-grained intelligent DNS resolution on the Manage DNS page.

gtm-12

5. Configure the test (Europe) instance.

  • On the Address Pool Configurations tab, click Create Address Pool to create the Germany and Singapore address pools and enable Health Check.

gtm-13

  • On the Access Policy tab, click Add Access Policy. Set the Default Address Pool to Germany and Alternative Address Pool to Singapore.

  • Set DNS Request Source to Global. Global Traffic Manager only supports part of the resolution lines. You can set DNS Request Source to Global and configure fine-grained intelligent DNS resolution on the Manage DNS page.

gtm-14

6. On the Global Settings tab of the test (China), test (Japan), and test (Europe) instances, copy the CNAME access domain names.

Copy the CNAME domain name

Configure DNS records

1 . On the Manage DNS page, find the domain name dns-example.com, and click Configure in the Actions column.

gtm

2 . Click Add Record to add three records. Set the values of the records to the CNAME access domain names of the test (China), test (Japan), and test (Europe) instances.

  • Set Type to CNAME.

  • Set Host to api because the subdomain name used in the example is api.dns-example.com.

  • Configure the resolution lines and record values based on the following figures.

gtm-111

gtm-133

gtm-1444

Verification

Intelligent DNS resolution

1. Verify that IP addresses in the Beijing address pool (1.1.1.1 and 2.2.2.2) are returned to visitors from China.

  • Open the DNS test tool.

  • On the Global DNS tab, click Advanced Settings, set Record Type to CNAME+A, and select all regions in China.

DNS resolution test for China

  • The test result shows that 1.1.1.1 and 2.2.2.2 in the Beijing address pool are returned to visitors from China. This indicates that the DNS records take effect.

Test result for China

2. Verify that IP addresses in the Japan address pool (10.10.10.10 and 12.12.12.12) are returned to visitors from Japan.

  • On the Global DNS tab, click Advanced Settings, set Record Type to CNAME+A, and select Japan in the Asia region.

Japan

  • The test result shows that 10.10.10.10 and 12.12.12.12 in the Japan address pool are returned to visitors from Japan. This indicates that the DNS records take effect.

Test result for Japan

3. Verify that IP addresses in the Germany address pool (13.13.13.13 and 14.14.14.14) are returned to visitors from Europe.

  • On the Global DNS tab, click Advanced Settings, set Record Type to CNAME+A, and select the Europe region.

Europe region

  • The test result shows that 13.13.13.13 and 14.14.14.14 in the Germany address pool are returned to visitors from Europe. This indicates that the DNS records take effect.

Test result for Europe


Failover

You can verify the failover configuration by using the Disaster Recovery Plan feature.