Configure a CNAME record for a domain

更新时间:
复制 MD 格式

Shared cloud hosting instances use a shared IP address. If this IP address is targeted by a DDoS attack, all hosts sharing it are affected. We recommend creating a CNAME record to resolve your domain name to the provided temporary domain name. This improves security by abstracting the underlying IP address. This topic describes how to configure a CNAME record for your domain name.

Prerequisites

You have registered a domain name and completed the real-name verification process.
Note You can register a domain name on the Alibaba Cloud Domain Name Service platform or with another domain registrar. If your website is deployed in mainland China, you must also complete an ICP filing to make the domain accessible.

Background information

The temporary domain name resolves to an IP address managed by Alibaba Cloud that can change at any time. This conceals your host's actual IP address, isolating your service from attacks and improving network security.

After your domain is registered and verified, you must configure its DNS resolution to make it accessible. The method for configuring DNS resolution depends on where your domain is registered:
Your Web Hosting instance is automatically assigned a temporary domain name upon purchase. You can find the temporary domain name on the Site Information page.
Note For more information about temporary domain names, see What is a temporary domain name?.

Enabling CNAME resolution for the temporary domain name can help mitigate some DDoS attacks, but it does not guarantee your website's availability. For greater protection, we recommend that you upgrade to dedicated cloud hosting, which provides a dedicated IP address. For more information, see Upgrade a Web Hosting instance.

Configure CNAME for Alibaba Cloud domains (enhanced shared hosting)

  1. Log on to the Web Hosting management page.
  2. Find the target shared cloud hosting instance and click Manage in the Actions column.
  3. In the left-side navigation pane, choose Domain Management > Domain Binding.
  4. On the Domain Binding page, click Bind Domain.
  5. In the Bind Domain dialog box, enter your domain name, select the If your domain uses Alibaba Cloud DNS, it will be automatically resolved to this host after binding checkbox, and then click Confirm.
    A tip at the top of the dialog box states that if you enter a root domain (for example, aliyun.com), the system automatically binds both the root domain and its www subdomain (for example, www.aliyun.com). The dialog box also provides an Or, select a HiChina domain name under your account drop-down list.
  6. In the confirmation message that appears, click Confirm.
    The dialog box shows the domain binding result. The upper list displays the bound domains and their Binding Status, which shows Bound. The lower list displays the domain's Expected Resolution Target, Resolution Status, and ICP Filing Status. If the ICP Filing Status is Not Filed, you can click File Now to start the ICP filing process.
    After the domain is successfully bound, the results are displayed on the Domain Binding page. The list of bound domains includes the Bound Domain, Resolution Address, ICP Filing Status, Forced HTTPS Encrypted Access, and Actions columns. A tip at the top of the page indicates that a host can have multiple domains bound to it. After binding, a domain must be resolved and have a completed ICP filing to be accessible. The tip also shows the maximum number of domains that can be bound and the current number of bound domains.

Configure CNAME for Alibaba Cloud domains (non-enhanced shared hosting)

For some non-enhanced shared cloud hosting instances, you must first enable CNAME resolution for the temporary domain name before you configure the CNAME record in the host management console. The console UI may vary.

  1. Log on to the Web Hosting management page.
  2. Find the target shared cloud hosting instance and click Manage in the Actions column.
  3. On the Site Information page, in the Website Information section, click Enable CNAME Resolution for Temporary Domain.
    The Enable CNAME Resolution for Temporary Domain link is located to the right of Running Status, on the same line as the Stop Site link.
  4. In the Resolve to Temporary Domain dialog box that appears, click Confirm.
  5. Configure the CNAME record for the domain.

Configure CNAME for external domains (enhanced shared hosting)

  1. In the Alibaba Cloud DNS console, configure the CNAME record for your domain.

    For detailed steps, see How do I configure DNS in Alibaba Cloud DNS for a domain not registered with Alibaba Cloud?.

    The following table describes the parameters for the CNAME record.

    Parameter Description
    Record Type Select CNAME.
    host record The subdomain prefix.
    • To create a resolution record for a subdomain such as www.dns-example.com, set the host record to www.
    • To create a resolution record for the root domain, such as dns-example.com, set the host record to @.
    Resolution Line Select Default.
    record value The domain name to which the CNAME record points. Enter your temporary domain name.
    TTL The cache duration. A smaller value means record changes take effect faster. The default is 10 minutes.
  2. Log on to the Web Hosting management console.
  3. In the left-side navigation pane, choose Domain Management > Domain Binding.
  4. On the Domain Binding page, click Bind Domain.
  5. In the Bind Domain dialog box, enter the domain name for which you configured the CNAME record, and then click Confirm.
    Important Do not select the If your domain uses Alibaba Cloud DNS, it will be automatically resolved to this host after binding checkbox.
  6. In the confirmation message, click Confirm to finish binding the domain.

Configure CNAME for external domains (non-enhanced shared hosting)

For some non-enhanced shared cloud hosting instances, you must first enable CNAME resolution for the temporary domain name before you configure the CNAME record. The console UI may vary.

  1. Log on to the Web Hosting management page.
  2. Find the target shared cloud hosting instance and click Manage in the Actions column.
  3. On the Site Information page, in the Website Information section, click Enable CNAME Resolution for Temporary Domain.
    The Enable CNAME Resolution for Temporary Domain link is located to the right of Running Status, on the same line as the Stop Site link.
  4. In the Resolve to Temporary Domain dialog box that appears, click Confirm.
  5. Configure the CNAME record for the domain.