Skip to main content

Custom domain

CloudBase static website hosting provides a default domain name for development and testing use. During development, you can access the static website via the default domain name. The default domain name has certain access frequency limits; if the access frequency limit is exceeded, the default domain name will become inaccessible.

For applications in production environments, we recommend using a custom domain to avoid frequency limits and accelerate user access.

Adding a custom domain

  1. Log in to the CloudBase console, go to the Static Website Hosting page, select Basic Settings, and in the Domain Information section, click Add Domain to add a custom domain, as shown in the following figure:
  2. After adding it, the system will automatically assign you a CNAME domain name with the suffix .cdn.dnsv1.com. The CNAME domain name cannot be accessed directly. You need to complete the CNAME configuration at your domain name service provider. After the configuration takes effect, your hosting service will become available for the custom domain. For how to configure CNAME, please refer to the section below.

Enforce HTTPS

Once enabled, all HTTP requests for the custom domain will be redirected to HTTPS.

Enabling this feature can enhance the security of your website. It is recommended that you do not disable it manually.

CNAME Configuration

Tencent Cloud Setup Guide

If your DNS service provider is Tencent Cloud, you can add a CNAME record by following the steps below.

  1. Log in to the Domain Name Service console. In the list, locate the row of the domain name for which you need to add a CNAME record, and click Resolve in the Operation column. CNAME Configuration
  2. On the redirected page, click Add Record.
  3. In the Host Record field, enter the domain prefix (e.g., www). Set Record Type to CNAME, fill in the CNAME domain name in the Record Value field, then click Save to add the CNAME record.
Note

There are priority differences among various record types in domain name resolution. When the host record is the same, different record types in the same line cannot coexist; otherwise, a conflict will be prompted. CNAME records conflict with all record types except CNAME records. You need to delete other records before configuration. For details, see Why is "record conflict" prompted when adding a resolution record?.

DNSPod Setup Guide

If your DNS service provider is DNSPod, log in to the DNSPod Domain Name Service console. In the list, locate the row of the domain name for which you need to add a CNAME record, click the corresponding domain name to navigate to the "Add Record" page, then add the CNAME record by following the steps below.

  1. Fill in the subdomain in the Host Record field (for example, to add a resolution record for www.123.com, simply enter www in the Host Record field. If you only want to add a resolution record for 123.com, leave the Host Record field blank—the system will automatically populate an "@" symbol in the input box. Note that a CNAME record for "@" may affect normal resolution of MX records; consider carefully before adding).
  2. Set Record Type to CNAME.
  3. Line Type (Required by default; otherwise, some users may fail to resolve. In the figure above, the default setting means: all users except those from China Unicom will be directed to 1.com).
  4. The record value is the domain name pointed to by the CNAME. Only a domain name can be entered. After the record is generated, a "." will automatically be appended to the end of the domain name—this is normal.
  5. The MX priority field does not need to be filled in.
  6. TTL does not need to be filled in; the system will automatically generate it upon addition, defaulting to 600 seconds (TTL represents the cache time—the lower the value, the faster record modifications propagate globally).

Hichina Setup Guide

If your DNS service provider is Hichina, you can add a CNAME record by following the steps below.

  1. Log in to the Hichina Member Center.
  2. Click "Product Management" > "My Cloud DNS" in the left navigation bar of the Member Center to access the Hichina Cloud DNS list page.
  3. Click the domain name to be resolved to access the resolution record page.
  4. After accessing the resolution record page, click the "Add Record" button to begin setting up the resolution record.
  5. To set up a CNAME resolution record, select CNAME for the record type. The host record is the domain prefix and can be filled in arbitrarily (e.g., www). Enter the target domain name in the record value field. Leave the resolution line and TTL at their default values.
  6. After filling in the information, click "Save" to complete the resolution setup.

Xinnet Setup Guide

If your DNS service provider is Xinnet, you can add a CNAME record by following the steps below. Setting Up an Alias (CNAME Record) That is: an alias record. This type of record allows you to map multiple names to the same computer. It is typically used for computers providing both WWW and MAIL services. For example, a computer named host.mydomain.com (A record) that provides both WWW and MAIL services. To facilitate user access to these services, you can set up two aliases (CNAME records): WWW and MAIL. As shown below:

Verify CNAME Record Effectiveness

Different DNS service providers have slightly different times for CNAME to take effect, usually within half an hour. You can also use the dig command to check if the CNAME has taken effect; if you dig a domain name with the suffix .cdn.dnsv1.com, it indicates that the CNAME for the domain has taken effect.