All Products
Search
Document Center

Global Accelerator:Add a CNAME record for a domain name

Last Updated:Sep 02, 2024

If you use Global Accelerator (GA) to accelerate a domain name, you must configure DNS settings and map the domain name that you want to accelerate to the CNAME that is allocated by GA. This topic describes how to add a CNAME record for a domain name by using Alibaba Cloud DNS.

Prerequisites

A standard GA instance is created, and an acceleration area, listener, and endpoint group are configured for the GA instance. For more information, see the following topics:

Step 1: Obtain the CNAME of the domain name that you want to accelerate

  1. Log on to the GA console.

  2. On the Instances page, find the GA instance that you want to manage and click the instance ID.

  3. On the page that appears, click the Instance Information tab.

  4. In the Basic Information section, find CNAME and click Copy to copy the CNAME.

    cname

Step 2: Add a CNAME record

  1. Log on to the Alibaba Cloud DNS console.

  2. If your domain name is not registered by using Alibaba Cloud Domains, you must add your domain name to Alibaba Cloud DNS.

    Note

    If your domain name is not registered by using Alibaba Cloud Domains, you must add your domain name to Alibaba Cloud DNS before you configure a DNS record. For more information, see the "Add a domain name" section of the Manage domain names topic. If your domain name is registered by using Alibaba Cloud Domains, skip this step.

  3. On the Domain Name Resolution page, find the domain name that you want to manage and click DNS Settings in the Actions column.

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

  5. In the Add Record panel, configure the parameters and click Confirm. The following table describes the parameters.

    Parameter

    Description

    Record Type

    Select CNAME from the drop-down list.

    Hostname

    Enter the prefix of the domain name that you want to accelerate.

    • If the accelerated domain name is www.aliyun.com, set the prefix to www.

    • If the accelerated domain name is aliyun.com, set the prefix to @.

    • If the accelerated domain name is *.aliyun.com, set the prefix to *.

    • If the domain name is mail.aliyun.com, set the prefix to mail.

    DNS Request Source

    Use the default value.

    Record Value

    Paste the CNAME that you copied in Step 1: Obtain the CNAME of the domain name that you want to accelerate.

    TTL

    Specify the period of time for which a record is cached by a DNS server. A smaller TTL value specifies that a modified DNS record takes effect in a shorter period of time.

    In this example, the default value 10 Minutes is used.

Note
  • If you want to return resolution results based on the region to which a client belongs, make sure that Alibaba Cloud DNS is upgraded to Enterprise Standard Edition or Enterprise Ultimate Edition. For more information, see the "Upgrade" section of the Renewal and upgrade topic.

    After the upgrade is complete, you can change the default ISP line of the existing A record to the ISP line of a specific region and add a CNAME record that maps the website domain name to the CNAME assigned to the GA instance.

  • If the backend service type of the endpoint is a custom domain name, the actual amount of time it takes for the DNS record to take effect depends on the following factors:

    • The TTL value for DNS server caching. You can specify the value when you configure DNS records.

    • The TTL value for GA caching: By default, GA obtains DNS records every 15 seconds.

Step 3: Check whether the CNAME record takes effect

View the regions where the CNAME record takes effect

  1. Log on to the GA console.

  2. On the Instances page, find the GA instance that you want to manage and click View DNS Records in the CNAME column.

  3. On the Network Detect Tool page, you can view the CNAME record.

    On the Network Detect Tool page, the system automatically selects detection points to perform instant detection based on the settings of the acceleration area.

    • If the acceleration area contains only regions in the Chinese mainland, the system uses the detection points in each region.

    • If the acceleration area contains only regions outside the Chinese mainland, the system uses the detection points in each region.

    • If the acceleration area contains regions inside and outside the Chinese mainland, the system uses all detection points.

    You can select the Internet service provider (ISP) and region to perform instant detection based on your business requirements.

    You can view the resolution result of each detection point. If the resolution result is the same as the accelerated IP address in the acceleration area, it indicates that the CNAME record takes effect in the region.

Check whether the CNAME record takes effect

Use the instant detection tool of Alibaba Cloud DNS

  1. Click Instant Detections to go to the Instant Detections page.

  2. Click the DNS Detection tab. On the page that appears, select the ISP and region to perform instant detection, enter an accelerated domain name, and then click Detect Now.

  3. In the Detection Result section, click 筛选.pngto the right of the Detection Point City column, enter the name of the accelerated region, and then click OK.

  4. View the detection result.

    If the resolution result is the same as the accelerated IP address or CNAME record of the GA instance, it indicates that the CNAME record takes effect in the region.

    DNS生效检测 INTL.png

Use a CLI

  1. Open Command Prompt on a client in the region where the access point is located.

    In this topic, the Alibaba Cloud Linux 3 system is used as an example.

  2. Run the ping command to ping the accelerated domain name.

    If the CNAME in the output is the same as the CNAME allocated by Global Accelerator, the CNAME record takes effect.CNAME生效验证

References