tencent cloud



Last updated: 2022-09-01 15:05:27

1. API Description

Domain name for API request: teo.tencentcloudapi.com.

This API is used to create a DNS record.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateDnsRecord.
Version Yes String Common Params. The value used for this API: 2022-01-06.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ZoneId Yes String Site ID
Type Yes String Record type
Name Yes String Record name
Content Yes String Record content
Mode Yes String Proxy mode. Valid values: dns_only, cdn_only, and secure_cdn.
Ttl No Integer
Priority No Integer Priority

3. Output Parameters

Parameter Name Type Description
Id String Record ID
Type String Record type
Name String Record name
Content String Record content
Ttl Integer
Priority Integer Priority
Mode String Proxy mode
Status String Resolution status. Valid values:
active: Activated
pending: Not activated
Locked Boolean Whether the DNS record is locked
CreatedOn Timestamp ISO8601 Creation time
ModifiedOn Timestamp ISO8601 Modification time
ZoneId String Site ID
ZoneName String Site name
Cname String CNAME address
Note: This field may return null, indicating that no valid value can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a DNS record

Input Example

Host: teo.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDnsRecord
<Common request parameters>

    "Priority": 0,
    "Name": "xx",
    "ZoneId": "xx",
    "Content": "xx",
    "Mode": "xx",
    "Ttl": 0,
    "Type": "xx"

Output Example

    "Response": {
        "Status": "xx",
        "Priority": 0,
        "Locked": true,
        "Name": "xx",
        "CreatedOn": "2020-09-22T00:00:00+00:00",
        "ZoneId": "xx",
        "Content": "xx",
        "Cname": "xx",
        "RequestId": "xx",
        "Ttl": 0,
        "ModifiedOn": "2020-09-22T00:00:00+00:00",
        "Mode": "xx",
        "Type": "xx",
        "Id": "xx",
        "ZoneName": "xx"

5. Developer Resources


TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidParameterValue.ConflictRecord It conflicts with existing records.
InvalidParameterValue.ConflictWithDNSSEC DNS records conflict with DNSSEC.
InvalidParameterValue.ConflictWithLBRecord This DNS record conflicts with CLB records.
InvalidParameterValue.ConflictWithNSRecord This DNS record conflicts with NS records.
InvalidParameterValue.InvalidDNSContent Incorrect DNS record
InvalidParameterValue.InvalidDNSName Incorrect DNS CNAME
InvalidParameterValue.InvalidProxyName Incorrect DNS proxied domain name.
InvalidParameterValue.InvalidProxyOrigin Incorrect DNS proxy
InvalidParameterValue.RecordAlreadyExists This record already exists.
InvalidParameterValue.RecordNotAllowed This record cannot be added.
OperationDenied Operation denied.
ResourceNotFound The resource doesn’t exist.
UnauthorizedOperation.CamUnauthorized CAM is not authorized.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support