Skip to main content

Custom Domain

CloudBase HTTP Access Service provides an automatically generated domain by default. You can also bind your custom domain to the CloudBase HTTP Access Service.

💡 Note: It is recommended to use the default domain only in test environments. To ensure the security and stability of your business, it is recommended to bind a custom domain in production environments.

Prerequisites

Before configuring a custom domain, make sure you have completed the following preparations:

  1. Domain Name Filing: Complete ICP filing. For details, refer to the ICP Filing Page
  2. SSL Certificate: Prepare an SSL certificate, which can be uploaded in the SSL Certificate Console

Add Domain

  1. Go to Cloud Development Platform/HTTP Access Service
  2. Click [Add Domain]
  3. Fill in the custom domain and configure the SSL certificate.
  4. Select CDN type

CDN Type Selection

When creating a custom domain, you can choose from the following three CDN types:

  • Without CDN: Suitable for scenarios that do not require CDN, such as main cloud hosting or cloud function services.
  • CloudBase CDN: Applicable to static hosting or custom applications. The system will automatically configure CDN acceleration services for you.
  • Custom CDN: When CloudBase CDN cannot meet your requirements, you can use Custom CDN to accelerate your services.

Custom CDN Configuration Process

When selecting Custom CDN, you need to follow these steps:

Step 1: Configure Origin Domain

  1. Copy the "Origin Domain"
  1. Go to the CDN Console and click "Add Domain"

  1. Paste the "Origin Domain"

  1. Copy the CNAME value from the CDN Console to "Custom CDN CName".

⚠️ Note: When using Tencent Cloud CDN, you need to enter the CNAME generated in the CDN console into the custom domain CNAME field. CloudBase will verify your domain ownership.

Step 2: Configure Domain CNAME Resolution Record

  1. Go to your domain service provider console.
  2. Locate the DNS record page
  3. Add CNAME record
Tip

The CNAME record value is determined by the CDN type you selected:

  • choose CloudBase CDN: use the CNAME provided by the HTTP access service
  • Choose Custom CDN: use the CNAME provided by the CDN Console

Step 3: Wait for the domain to take effect

After adding a CNAME record, it usually takes 5-30 minutes for DNS resolution to take effect. You can check whether the domain name resolution has taken effect by using the following command:

nslookup your custom domain

If the returned result displays the CNAME domain provided by CloudBase, it indicates that the resolution has taken effect.

Modify CDN Type

After binding the domain, if you need to modify the CDN type, follow the steps below:

  1. Find the target domain in the domain list
  2. Click "Modify CDN"
  3. Follow the on-screen instructions to complete the configuration

⚠️ Note: After modifying the CDN type, you need to manually update the DNS resolution records for the new CDN configuration to take effect.

Usage Limits

  • Each CloudBase environment can bind up to 5 custom domain names.
  • Custom domain names must have completed ICP filing.
  • DNS resolution takes some time to take effect; please wait patiently.

Tencent Cloud DNS Configuration Guide

If your DNS service provider is Tencent Cloud, follow the steps below to add a CNAME record:

  1. Log in to the Domain Service Console
  2. Locate the target domain name in the domain list and click "Resolve" in the operation column
  1. On the resolution page, click "Add Record"
  1. Configure resolution record:
    • Host Record: Enter the domain prefix (e.g., @)
    • Record Type: Select CNAME
    • Record Value: Enter the CNAME value
    • Click "Save" to complete the configuration
Tip

There are priority differences among various record types in domain name resolution. When the host records are the same, different record types under the same line cannot coexist; otherwise, a conflict will be prompted. CNAME records conflict with any record type other than CNAME records. You need to delete other records before configuring. For details, see Why does adding a resolution record prompt "record conflict"?.

Domain Ownership Verification

To confirm that you indeed own the domain, you can choose any one of the following methods to perform domain ownership verification:

  • Configure domain CNAME resolution record
  • Configure domain TXT resolution record
  • Configure TXT resolution record for specific subdomain

Option one: Configure domain CNAME resolution record

Configure your domain's CNAME as the domain provided in the CloudBase control console.

For example, your domain is foo.com, you can set the domain's CNAME record to foo.com.cdn.dnsv1.com.

Option two: Configure domain TXT resolution record

Configure the TXT resolution record of your domain to its CloudBase environment ID.

For example, your domain is foo.com and the environment ID is bar-12345, you can set the TXT record for foo.com to bar-12345.

Option three: Configure TXT resolution record for specific subdomain

Configure the TXT resolution record for the specific subdomain _cloudbase-challenge of your domain to its CloudBase environment ID.

For example, your domain is foo.com and the environment ID is bar-12345, you can set the TXT record for _cloudbase-challenge.foo.com to bar-12345.