Domain name for API request: teo.intl.tencentcloudapi.com.
After a site is created and accessed in NS mode, you can create DNS records through this API.
A maximum of 20 requests can be initiated per second for this API.
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-09-01. |
| Region | No | String | Common Params. This parameter is not required. |
| ZoneId | Yes | String | Zone ID. |
| Name | Yes | String | DNS record name. If it is a Chinese, Korean, or Japanese domain name, it needs to be converted to punycode before input. |
| Type | Yes | String | DNS record type. Valid values: Different record types, such as SRV and CAA records, have different requirements for the host record name and record value format. For detailed descriptions and format examples of each record type, see DNS Record Type Introduction. |
| Content | Yes | String | DNS record content. Fill in the corresponding content based on the Type value. If it is a Chinese, Korean, or Japanese domain name, convert it to punycode before input. |
| Location | No | String | DNS record resolution route. If not specified, it defaults to Default, which means the default parsing route and takes effect in all regions. -Resolution line configuration is applicable only when Type (DNS record type) is A, AAAA, or CNAME. - Route parsing line configuration is applicable only to the standard and enterprise plans. For values, see Resolution Routes and Corresponding Code Enumeration. |
| TTL | No | Integer | Cache time. You can specify a range of 60–86400. A smaller value means modification records take effect faster in each region. Default value: 300. Unit: seconds. |
| Weight | No | Integer | DNS record weight. Users can specify a value range of -1 to 100. When set to 0, it means no parsing. If not specified, it defaults to -1, indicating no weight is set. Weight configuration is applicable only when Type (DNS record type) is A, AAAA, or CNAME. Note: For different DNS records under the same subdomain and resolution route, set weight for all of them simultaneously or leave all of them unset. |
| Priority | No | Integer | MX record priority. This parameter is valid only when Type (DNS record type) is MX. A smaller value indicates higher priority. You can specify a value from 0 to 50. If not specified, the default is 0. |
| Parameter Name | Type | Description |
|---|---|---|
| RecordId | String | DNS record ID. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Create a DNS record named www.example.com with the record type A, record content 1.2.3.4, and cache time 60 seconds for the site with ZoneId zone-225qgrnvbi9w.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDnsRecord
<Common request parameters>
{
"ZoneId": "zone-225qgrnvbi9w",
"Name": "www.example.com",
"Type": "A",
"Content": "1.2.3.4",
"TTL": 60
}
{
"Response": {
"RequestId": "5e0a2b4e-df6d-4d2a-ac39-1706cbf8a707",
"RecordId": "record-225rcy8bw85g"
}
}
Create a DNS record named www.example.com with the record type A, record content 1.2.3.4, cache time 60 seconds, and record weight 100 for the site with ZoneId zone-225qgrnvbi9w.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDnsRecord
<Common request parameters>
{
"ZoneId": "zone-225qgrnvbi9w",
"Name": "www.example.com",
"Type": "A",
"Content": "1.2.3.4",
"TTL": 60,
"Weight": 100
}
{
"Response": {
"RequestId": "5e0a2b4e-df6d-4d2a-ac39-1706cbf8a707",
"RecordId": "record-225rcy8bw85g"
}
}
Create a DNS record named www.example.com with the record type A, resolution route Beijing (CN.BJ), record content 1.2.3.4, and cache time 60 seconds for the selected site with ZoneId zone-225qgrnvbi9w.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDnsRecord
<Common request parameters>
{
"ZoneId": "zone-225qgrnvbi9w",
"Name": "www.example.com",
"Type": "A",
"Location": "CN.BJ",
"Content": "1.2.3.4",
"TTL": 60
}
{
"Response": {
"RequestId": "5e0a2b4e-df6d-4d2a-ac39-1706cbf8a707",
"RecordId": "record-225rcy8bw85g"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
There is no error code related to the API business logic. For other error codes, please see Common Error Codes.
피드백