Skip to main content

Custom Domain

CloudBase HTTP Access Service provides automatically generated domains by default. You can also bind custom domains to CloudBase HTTP Access Service.

💡 Note: Default domains are recommended for use only in test environments. To ensure business security and stability, it is recommended to bind custom domains in production environments.

Prerequisites

Before configuring a custom domain, please ensure you have completed the following preparations:

  1. Domain Filing: Prepare a custom domain and complete ICP filing. For details, refer to the ICP Filing page. For cloud resources required for filing, refer to Filing Cloud Resources
  2. SSL Certificate: Prepare an SSL certificate, which can be uploaded in the SSL Certificate Console

Adding Domain

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

CDN Type Selection

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

  • No CDN: Suitable for main cloud hosting or cloud function services that do not require CDN
  • CloudBase CDN: Suitable for static hosting or custom applications, the system will automatically configure CDN acceleration service for you
  • Custom CDN: When CloudBase CDN cannot meet your needs, you can use Custom CDN to accelerate your services

⚠️ Note: This CDN is used for HTTP-related resource calls. If you want to add CDN to cloud storage, please refer to Cloud Storage Custom CDN

CDN Configuration Process

If you select CloudBase CDN, please proceed to Step 2 for configuration

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

Step 1: Configure Origin Domain (Custom CDN)

  1. Copy the "Origin Domain"
  1. Go to CDN Console, 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 fill in the CNAME generated by 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's backend
  2. Find the domain resolution record page
  3. Add CNAME record
Tip

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

  • Select CloudBase CDN: Use the CNAME provided by HTTP Access Service
  • Select Custom CDN: Use the CNAME provided by the CDN Console in the previous step

Step 3: Wait for Domain to Take Effect

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

nslookup your-custom-domain

If the returned result shows the CNAME domain provided by CloudBase, it means the resolution has taken effect.

Usage Limitations

  • Each CloudBase environment can bind up to 5 custom domains
  • Custom domains must have completed ICP filing
  • Domain resolution takes time to take effect, please be patient

Domain Ownership Verification

To confirm that you actually own the domain, you can choose any of the following methods for domain ownership verification:

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

Option 1: Configure Domain CNAME Resolution Record

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

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

Option 2: Configure Domain TXT Resolution Record

Configure your domain's TXT resolution record to the CloudBase environment ID it belongs to.

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

Option 3: Configure TXT Resolution Record for Specific Subdomain

Configure the TXT resolution record of your domain's specific subdomain _cloudbase-challenge to the CloudBase environment ID it belongs to.

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

Tencent Cloud DNS Setup Method

If your DNS service provider is Tencent Cloud, you can add CNAME records by following these steps:

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

There are priority differences between various record types in domain resolution. When the host record is the same, different record types on the same line cannot coexist, otherwise conflicts will be prompted. CNAME records conflict with any record type except CNAME records, and other records need to be deleted before configuration. For details, please refer to Why does it prompt "record conflict" when adding resolution records.