All Products
Search
Document Center

Global Traffic Manager:Implement regional intelligent DNS resolution by using GTM

Last Updated:Oct 09, 2023

Scenarios

In most cases, enterprises deploy their application services on multiple servers whose IP addresses may come from data centers of different countries, regions, Internet service providers (ISPs), or vendors. You can use the intelligent Domain Name System (DNS) resolution feature of Alibaba Cloud DNS to forward user requests to the nearest application servers. However, DNS servers cannot detect the availability of IP addresses. When some IP addresses are unavailable because the corresponding application servers encounter faults or disasters, the DNS servers may still return the IP addresses of these faulty application servers to users. As a result, users fail to access the applications.

Solutions

  • Enable the intelligent DNS resolution feature of Alibaba Cloud DNS to forward user requests to the nearest application servers.

  • Enable the health check feature of Global Traffic Manager (GTM) to implement failover or redundancy.

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

Sample scenario

Enterprise A deployed application servers in the following regions:

  • China (Beijing): 192.0.2.1 and 192.0.2.2

  • China (Shanghai): 192.0.2.3 and 192.0.2.4

  • Japan (Tokyo): 192.0.2.5 and 192.0.2.6

  • Germany (Frankfurt): 192.0.2.7 and 192.0.2.8

  • Singapore: 192.0.2.9 and 192.0.2.10

Expected results of intelligent DNS resolution

  • The requests of users from the Chinese mainland are forwarded to the application servers whose IP addresses are 192.0.2.1 and 192.0.2.2 in the China (Beijing) region.

  • The requests of users from Japan are forwarded to the application servers whose IP addresses are 192.0.2.5 and 192.0.2.6 in the Japan (Tokyo) region.

  • The requests of users from Europe are forwarded to the application servers whose IP addresses are 192.0.2.7 and 192.0.2.8 in the Germany (Frankfurt) region.

Expected failover results

  • Failover between the application servers in the China (Beijing) and China (Shanghai) regions

  • Failover between the application servers in the Japan (Tokyo) and Singapore regions

  • Failover between the application servers in the Germany (Frankfurt) and Singapore regions

For example, if the application servers in the China (Beijing) region are faulty, access traffic to the China (Beijing) region is forwarded to the application servers in the China (Shanghai) region. This ensures business continuity.

Prepare resources

Prepare a domain name.

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

Purchase Alibaba Cloud DNS

  • In this topic, fine-grained intelligent DNS resolution is used. You must purchase Enterprise Standard Edition or Enterprise Ultimate Edition of Alibaba Cloud DNS. For more information about the resolution lines supported by Enterprise Standard Edition, see the Supported intelligent resolution lines section of the Intelligent DNS resolution topic.

  • An instance of Alibaba Cloud DNS Enterprise Standard Edition is required.

If you do not have an instance of Alibaba Cloud DNS Enterprise Standard Edition within your account, click here to purchase one.

Purchase GTM instances

If you provide the same subdomain name for users from different regions, you can determine the number of GTM instances that need to be purchased based on the number of intelligent resolution records. In this example, different IP addresses are returned to users from the Chinese mainland, Japan, and Europe. This requires three intelligent resolution records. Therefore, you must purchase three GTM instances.

If you do not have a GTM instance within your account, click here to purchase GTM instances.

Procedure

  1. Log on to the Alibaba Cloud DNS console.

  2. In the left-side navigation pane, click Global Traffic Manager. On the Global Traffic Manager page, find the GTM instance that you want to manage and click Settings in the Actions column.

Configure the instance for access from the Chinese mainland

  1. Click the Address Pools tab. On the Address Pools page, click Create Address Pool to create two address pools: China (Beijing) and China (Shanghai).

    image.png
  1. GTM implements failovers based on health check results. You must turn on Health Check for the address pools. If you want to modify health check configurations, click Edit. For more information about health check configurations, see Enable the health check feature. In this topic, the TCP health check feature is enabled.image.png

  1. On the Basic Settings page, find Geographical Location-based Access Policy in the Access Policy Type section and click Settings.

  1. Click Create Access Policy and set the required parameters to create an access policy. Select the China (Beijing) address pool for the Primary Address Pool Set parameter and the China (Shanghai) address pool for the Secondary Address Pool Set parameter.

  1. Set DNS Request Source to Global.

    image.png
  1. On the Basic Settings page, click Modify. Set Instance Name to Chinese mainland and set Business Domain Name(Internet) to cloud-example.com. Specify the following parameters: CNAME(Internet), Global TTL Period, Alert Group, and Notification Methods.

Configure the instance for access from Japan

  1. On the Address Pools page, click Create Address Pool to create two address pools: Japan (Tokyo) and Singapore. Then, enable the health check feature for the address pools.

  1. On the Basic Settings page, find Geographical Location-based Access Policy in the Access Policy Type section and click Settings.

  1. Click Create Access Policy and set the required parameters to create an access policy. Select the Japan (Tokyo) address pool for the Primary Address Pool Set parameter and the Singapore address pool for the Secondary Address Pool Set parameter.

  1. Set DNS Request Source to Global.image.png

  2. On the Basic Settings page, click Modify. Set Instance Name to Japan and set Business Domain Name(Internet) to cloud-example.com. Specify the following parameters: CNAME(Internet), Global TTL Period, Alert Group, and Notification Methods.

Configure the instance for access from Europe

  1. On the Address Pools page, click Create Address Pool to create two address pools: Germany (Frankfurt) and Singapore. Then, enable the health check feature for the address pools.

  1. On the Basic Settings page, find Geographical Location-based Access Policy in the Access Policy Type section and click Settings.

  1. Click Create Access Policy and set the required parameters to create an access policy. Select the Germany (Frankfurt) address pool for the Primary Address Pool Set parameter and the Singapore address pool for the Secondary Address Pool Set parameter.

  1. Set DNS Request Source to Global.image.png

  1. On the Basic Settings page, click Modify. Set Instance Name to Europe and set Business Domain Name(Internet) to cloud-example.com. Specify the following parameters: CNAME(Internet), Global TTL Period, Alert Group, and Notification Methods.

Integrate a service domain name with GTM

  1. On the Basic Settings tab, copy the value of CNAME(Internet) of the Chinese mainland, Japan, and Europe GTM instances.

    image.png
  1. In the left-side navigation pane, click Domain Name Resolution. On the Authoritative Domain Names tab of the Domain Name Resolution page, find the domain name dns-example.com and click DNS Settings in the Actions column.

  2. Click Add DNS Record. In the Add DNS Record panel, add three CNAME records to map the domain name to the CNAME(Internet) values of the Chinese mainland, Japan, and Europe GTM instances.

DNS record for access from the Chinese mainland

  • Record Type: Select CNAME.

  • Hostname: Enter api because the subdomain name used in this example is api.dns-example.com.

  • DNS Request Source: Select Default.

  • Record Value: The CNAME of the Chinese mainland GTM instance is entered in this example. You must enter a record value based on your business requirements.

DNS record for access from Japan

  • Record Type: Select CNAME.

  • Hostname: Enter api because the subdomain name used in this example is api.dns-example.com.

  • DNS Request Source: Select Outside mainland China > Asia > Japan.

  • Record Value: The CNAME of the Japan GTM instance is entered in this example. You must enter a record value based on your business requirements.

DNS record for access from Europe

  • Record Type: Select CNAME.

  • Hostname: Enter api because the subdomain name used in this example is api.dns-example.com.

  • Request Source: Select Outside mainland China > Europe.

  • Record Value: The CNAME of the Europe GTM instance is entered in this example. You must enter a record value based on your business requirements.

    Note
    • After you complete the preceding configurations, you can test whether the resolution lines take effect.

    • You can configure an access control list (ACL) policy for one of the IP addresses of the application service to make the IP address inaccessible. In this way, you can test whether the health check and automatic failover features of GTM run as expected.