The first time you add a domain name to the Dynamic Content Delivery Network (DCDN) console, the system verifies the ownership of the domain name. After the domain name passes ownership verification, lower-level domain names of the domain name do not require ownership verification.
Method 1: (Recommended) Use a DNS record to verify the ownership
Use the console
The domain name image.example.com
is used as an example to show how to verify the ownership of a domain name by adding a DNS record.
On the verification page, click the Method 1: DNS Settings tab to obtain the values of the Host and Value parameters.
ImportantDo not close the verification page before the verification is complete. In specific cases, DNS record verification may fail. If DNS record verification fails, you can use Method 2: Upload a verification file to verify the ownership.
Add a TXT record in the system of your DNS service provider.
The following example shows how to add a TXT record. Alibaba Cloud DNS is used as the DNS service provider in this example. You can use similar methods to add TXT records in the systems of other DNS service providers, such as Tencent Cloud and Xinnet.
Log on to the Alibaba Cloud DNS console.
On the Domain Name Resolution page, find the root domain
example.com
and click DNS Settings in the Actions column.Click Add DNS Record, set the Record Type parameter to TXT, set the Hostname and Record Value parameters to the values that are obtained in Step 1, and then use the default values for other parameters.
Click OK.
After the TXT record takes effect, log on to the DCDN console and click Verify.
If a message indicating that the domain name fails the verification appears, check whether the TXT record is correct. Wait for the TXT record to take effect and try again.
The accelerated domain name
image.example.com
is used in the following examples to check whether the TXT record is correct.NoteIf you add a TXT record, the TXT record immediately takes effect. If you modify a TXT record, the amount of time that is required for the updates to take effect is based on the TTL. The default TTL is 10 minutes.
If dig is not installed on Linux, you can run the
yum install bind-utils
command to install dig.
Example for Windows: Open the Command Prompt in Windows, and then run the
nslookup -qt=txt verification.example.com
command. You can check whether the TXT record is correct based on the output.Example for Linux:Run the
dig verification.example.com txt
command. You can check whether the TXT record is correct based on the output.
Call API operations
If you want to call the AddDcdnDomain or BatchAddDcdnDomain API operation to add a domain name, you need to first call the relevant API operation to verify the ownership.
Call the DescribeDcdnVerifyContent API operation to query the record value.
Add a TXT record in the system of your DNS service provider. For more information, see Step 2.
Call the VerifyDcdnDomainOwner API operation to verify the ownership of a domain name. The operation verifies the ownership of one domain name at a time.
Set the VerifyType parameter to dnsCheck.
Call the AddDcdnDomain or BatchAddDcdnDomain API operation to add the domain name.
Method 2: Upload a verification file to verify the ownership
Use the console
On the verification page, click the Method 2: Verification File tab.
ImportantDo not close the verification page before the verification is complete.
Click
verification.html
to download the verification file.Upload the verification file to the root directory on the server of the root domain name. The server can be an ECS instance, an OSS bucket, a CVM instance, a COS instance, or an EC2 instance. For example, if the domain name is
image.example.com
, you need to upload the file to the root directory ofexample.com
.After you make sure that the verification file is accessible from
http://example.com/verification.html
, click Verify.DCDN accesses
http://example.com/verification.html
on your server for verification.If the record value in the file is the same as the record value in the verification file, the verification is successful.
Otherwise, the verification fails. Make sure that the preceding URL is accessible and the file that you uploaded is valid.
Call API operations
If you want to call the or API operation to add a domain name, you need to first call the relevant API operation to verify the ownership.
Call the DescribeDcdnVerifyContent API operation to query the record value.
NotePrepare the verification file: Create a new file named
verification.html
and write the obtained record value toverification.html
.Upload the verification file to the root directory on the server of the root domain name. The server can be an ECS instance, an OSS bucket, a CVM instance, a COS instance, or an EC2 instance.
Call the VerifyDcdnDomainOwner API operation to verify the ownership of a domain name. The operation verifies the ownership of one domain name at a time.
Set the VerifyType parameter to fileCheck.
Call the AddDcdnDomain or AddDcdnDomain API operation to add the domain name.
FAQ
The following questions may arise the first time a domain name is added to Alibaba Cloud CDN: