Help Center> Content Delivery Network> Getting Started> Verifying the Domain Name Ownership
Updated on 2024-05-16 GMT+08:00

Verifying the Domain Name Ownership

Scenario

When connecting a domain name to CDN for the first time, verify the ownership of the domain name through file upload or DNS record verification, to prevent the domain name from being maliciously added.

Precautions

  • After you verify the ownership of a domain name, ownership verification is not required for its subdomains or this domain name if you add it to CDN again.
    • Example: If you have verified the domain name ownership when adding the domain name b.a.com to CDN, you do not need to verify the ownership of subdomains of a.com, such as **.a.com and ***.a.com, when you add them to CDN.
  • If you have verified the ownership of a domain name using account A, you must verify the ownership of this domain name again when adding it to CDN using account B.
  • This topic is also applicable to the ownership verification of subdomains.

File Upload

Domain name test.example.com is used as an example.

  1. When adding a domain name to CDN, verify the ownership of the domain name in scenarios similar to the following.
    Figure 1 Verifying the domain name ownership
  1. Select File Upload. Do not close the verification page before the verification is complete.
  2. Click verification.html to download the file.
  3. Upload the file to the root directory of your domain server.
  4. Click Verify to verify the ownership of the domain name.

    Huawei Cloud CDN will access http://example.com/verification.html to obtain the verification file. If the system verifies that the obtained file is correct, the verification is successful. Ensure that the verification file is accessible.

DNS Record

Domain name test.example.com provided by Huawei Cloud DNS is used as an example.

  1. When adding a domain name to CDN, verify the ownership of the domain name in scenarios similar to the following. Do not close the verification page before the verification is complete.
    Figure 2 Verifying the domain name ownership
  2. Add a TXT record to the record sets of your DNS provider.
    1. In the service list, choose Networking > Domain Name Service.
    2. In the navigation pane, choose Public Zones.
    1. Click example.com. In the upper right corner of the domain name details page, click Add Record Set.
      • Name: cdn_verification
      • Type: TXT
      • Value: Enter 32 characters, consisting of a date and a random UUID.
        Figure 3 Adding a record set
    1. Click OK.
  3. After the TXT resolution takes effect, return to the Add Domain Names page of the CDN console and click Verify.
  • A new TXT resolution takes effect immediately. If it is modified, the modification takes effect 5 minutes later. The effective time depends on the DNS resolution time to live (TTL). The default TTL is 5 minutes.
  • The configuration of other service providers, such as www.net.cn, DNSPod, Xinnet, or GoDaddy, is similar. You can verify the ownership of your domain name by referring to the preceding procedure.