All Products
Search
Document Center

Edge Security Acceleration:CNAME setup

Last Updated:Nov 06, 2024

If you select CNAME for DNS setup when you add a website, you need to add a DNS record to map the domain that you want to proxy to the CNAME assigned by Edge Security Acceleration (ESA) . This way, user requests destined for your domain can be forwarded to ESA points of presence (POPs). This enables content delivery acceleration, edge computing, and enhanced protection.

Verify domain ownership

The first time you add a domain to DCDN, you must verify the ownership of the domain. Once the domain passes the verification, its subdomains do not require separate ownership verification.

Procedure

  1. Log on to the ESA console.

  2. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  3. Obtain the TXT record.

    On the Overview page

    In the left-side navigation tree, click Overview and copy the Hostname and Record Value assigned to your website.

    image

    On the Records page

    In the left-side navigation pane, choose DNS > Records.

    image

  4. Add the TXT record to the DNS settings of your domain at your DNS provider. The following example shows how to add a TXT record to the DNS settings at Alibaba Cloud DNS. You can use similar methods to add TXT records to the systems of other DNS providers, such as Tencent Cloud and Xinnet.

    1. Log on to the Alibaba Cloud DNS console.

    2. On the Domain Name Resolution page, find the root domain, such as example.com, and click DNS Settings in the Actions column.

    3. Click Add DNS Record. Set Record Type to TXT, enter the hostname and record value that you obtained in Step 3, and retain the default values for other parameters.

    4. Click OK.

  5. Wait until the TXT record takes effect. Then return to the DCDN console and click Verify.

  6. Confirm that the status of the website changes to Active.

Add DNS records and enable proxy

You can upload a file to import DNS records or manually add them for your domain.

Note

In CNAME setup, you can only add A, AAAA, and CNAME records, for which proxy cannot be disabled.

Import DNS records at a time (recommended)

  1. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  2. In the left-side navigation pane, choose DNS > Records.

  3. Click Import. On the Import page, click Download Template. Then modify the downloaded template as needed. Example:

    ;Host TTL IN RecordType RecordValue
    ;You can only import A, AAAA, and CNAME records for websites connected in CNAME setup.
    
    $ORIGIN example.com.
    
    ; A record
    1.example.com.   600 IN  A   8.8.8.8
    
    ; AAAA record
    2.example.com.   600 IN  AAAA		2400:cb00:2049:1::a29f:f9
    
    ; CNAME record
    2.example.com.   600 IN  CNAME     example.com.
  4. Click Select File to import the DNS records.

    Note

    After the import, A and AAAA records that correspond to the same hostname are collectively referred to as one A/AAAA record.

  5. Select an appropriate business scenario to further improve the acceleration performance.

  6. Click OK.

Add DNS records manually

  1. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  2. In the left-side navigation pane, choose DNS > Records.

  3. Click Add Record. In the dialog box that appears, add a DNS record.

    Parameter

    Description

    Proxy Status

    In CNAME setup, proxy cannot be disabled.

    Record Type

    Supported record types are A, AAAA, and CNAME.

    Hostname

    The prefix of the subdomain. For example, if you add a subdomain named www.example.com, enter www in the Hostname field.

    Record Value

    Enter the value based on the selected record type. For example, the record value of an A record is an IP address.

    TTL

    Specifies how long resolution results are retained in the local DNS cache.

    Note

    The TTL cannot be adjusted for proxied DNS records.

  4. Click Next and select a business scenario based on your business requirements.

  5. Click OK.

Note

By default, when an ESA POP requests resources from the origin server, the domain name in a client request is used as the Host request header. If you configure an origin domain name that is different from the requested domain name, such as one that a CNAME record points to, you need to modify the Host request header in origin requests to ensure that desired resources are returned. For more information, see Origin host.

Add a CNAME record to enable proxy

After you add the DNS records to DCDN, you must add a CNAME record to map your domain to the CNAME. This way, requests are forwarded to POPs to implement content delivery acceleration, edge computing, and protection.

Different DNS providers have different methods to add CNAME records.

Important
  • Make sure that the DNS records do not conflict with each other in the same system.

  • The server that DCDN uses for domain name resolution is deployed in the Chinese mainland. If you configure region-specific DNS settings for your domain name, for example, you add a CNAME record for your DCDN-accelerated domain name only in regions outside the Chinese mainland, including Hong Kong (China), Macao (China), and Taiwan (China), the domain name cannot be mapped to the CNAME. The CNAME status is Pending Configuration in the DCDN console. However, acceleration for the domain name is not affected.

  • CNAMEs that are assigned by Alibaba Cloud CDN, DCDN, ApsaraVideo Live, and ApsaraVideo VOD can be used only for domain name resolution. If Alibaba Cloud detects that your CNAME is used for unauthorized or malicious activities, Alibaba Cloud reserves the right to close your Alibaba Cloud account and remove the domain names.

Alibaba Cloud

If your DNS provider is Alibaba Cloud, perform the following steps to add a CNAME record for the domain:

  1. Log on to the Alibaba Cloud DNS console with the Alibaba Cloud account to which the domain belongs.

  2. Optional. Add a domain that is not registered with Alibaba Cloud.

    Note

    If the domain is not registered with Alibaba Cloud, you need to add the domain to Alibaba Cloud DNS before you can add a DNS record for the domain. For more information, see Manage domain names. If the domain is registered with Alibaba Cloud, skip this step.

  3. On the Domain Name Resolution page, find your domain and click DNS Settings in the Actions column.

  4. Click Add DNS Record to add a record.

    Note

    The CNAME record of a specific domain takes precedence over that of a wildcard domain. If you want to accelerate a wildcard domain, where the DNS record contains an asterisk (*), you need to delete all other DNS records that match the wildcard domain.

    添加记录

    Parameter

    Description

    Example

    Record Type

    Select CNAME.

    CNAME

    Hostname

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    DNS Request Source

    Select Default from the drop-down list.

    We recommend that you keep the default setting.

    Record Value

    Enter the CNAME of the domain.

    Note

    Each domain is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain. For more information, see Add a domain name.

    www.example.com.w.kunlunsl.com

    TTL Period

    Enter a time-to-live (TTL) value for the record. A smaller value indicates that the record is updated quicker. The default TTL is 10 minutes.

    We recommend that you keep the default setting.

  5. Click OK.

Tencent Cloud

If your DNS provider is Tencent Cloud, perform the following steps to add a CNAME record for the domain:

  1. Log on to the DNSPod console.

  2. On the DNSPod page, click Add Records to add a CNAME record.

    Parameter

    Description

    Example

    Host

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Type

    Select CNAME.

    CNAME

    Split Zone

    Select Default.

    We recommend that you keep the default setting.

    Value

    Enter the CNAME of the domain.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.

    www.example.com.w.kunlunsl.com

    Weight

    You do not need to set this parameter.

    N/A

    MX

    You do not need to set this parameter.

    N/A

    TTL

    Enter a TTL value for the CNAME record. A smaller value indicates that the record is updated quicker.

    We recommend that you keep the default setting.

  3. Click Confirm.

Huawei Cloud

  1. Log on to the DNS console.

  2. In the left-side navigation pane, click Public Zones. The Public Zones page appears.

  3. In the row of the domain for which you want to add a CNAME record, click the domain name.

  4. Click Add Record Set. On the page that appears, add a CNAME record.

    Parameter

    Description

    Example

    Name

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Type

    Select CNAME.

    CNAME

    Alias

    You do not need to set this parameter.

    No

    Line

    Select Default.

    Keep the default setting.

    TTL (s)

    Enter a TTL value for the CNAME record. A smaller value indicates that the record is updated quicker.

    Keep the default setting.

    Value

    Enter the CNAME of the domain.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.

    https://www.example.com.w.kunlunsl.com/

    Weight

    You do not need to set this parameter.

    N/A

  5. Click OK.

Cloudflare

  1. Log in to your Cloudflare account and select the domain for which you want to add a CNAME record.

  2. On the page that appears, choose DNS > Records. Click Add record to add a CNAME record.

    Parameter

    Description

    Example

    Type

    Select CNAME.

    CNAME

    Name (required)

    Enter the hostname.

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Target (required)

    Enter the CNAME of the domain.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.

    https://www.example.com.w.kunlunsl.com/

    Proxy status

    Disable proxy.

    Disabled

    TTL

    Enter a TTL value for the CNAME record. A smaller value indicates that the record is updated quicker.

    Auto

  3. Click Save.

AWS (Amazon Route 53)

See Creating records by using the Amazon Route 53 console.

Google Cloud

  1. Log on to Google Cloud console and go to the Cloud DNS page.

  2. Click the domain for which you want to add a CNAME record.

  3. On the Zone details page, click ADD RECORD SET to add a CNAME record.

    Parameter

    Description

    Example

    DNS Name

    Enter the hostname.

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Resource Record Type

    Select CNAME.

    CNAME

    TTL

    Enter a TTL value for the CNAME record. A smaller value indicates that the record is updated quicker.

    Auto

    Canonical name

    Enter the CNAME of the domain.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.

    https://www.example.com.w.kunlunsl.com/

  4. Click Create.

GoDaddy

  1. Sign in to your GoDaddy Domain Portfolio.

  2. Click the domain for which you want to add a CNAME record to access its Domain Settings page.

  3. Click DNS to view your DNS records for the domain. Select Add New Record and then select CNAME from the Type menu.

    Parameter

    Description

    Example

    Name

    Enter the hostname.

    • For root domains, enter @.

    • For wildcard domains, enter *.

    • For subdomains, enter the prefix of the subdomain.

    • Root domains

      • aliyundoc.com: @

      • aliyundoc.com.cn: @

    • Wildcard domains

      • .aliyundoc.com: *

      • .aliyundoc.com.cn: *

      • *.example.aliyundoc.com: *.example

      • *.example.aliyundoc.com.cn: *.example

    • Subdomains

      • example.aliyundoc.com: example

      • example.aliyundoc.com.cn: example

      • www.example.aliyundoc.com: www.example

      • www.example.aliyundoc.com.cn: www.example

    Note

    .com.cn is a top-level domain that consists of two hierarchical levels.

    Value

    Enter the CNAME of the domain.

    Note

    Each accelerated domain name is assigned a unique CNAME. Subdomains cannot use the CNAME of the root domain. If you want to accelerate a subdomain, add the subdomain to DCDN. Alibaba Cloud then assigns a CNAME to the subdomain. Alternatively, you can add a wildcard domain name to DCDN. Subdomains that match the wildcard domain name are mapped to the CNAME of the wildcard domain name. For more information, see Add a domain name.

    https://www.example.com.w.kunlunsl.com/

    TTL (Time to Live)

    Enter a TTL value for the CNAME record. A smaller value indicates that the record is updated quicker.

    Auto

  4. Click Save.