Calls the AddDomainRecord operation to add a DNS record based on input parameters.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddDomainRecord |
The operation that you want to perform. Set the value to AddDomainRecord. |
DomainName | String | Yes | example.com |
The domain name. |
RR | String | Yes | www |
The host record. For example, to resolve @.example.com, you must set RR to an at sign (@) instead of leaving it blank. |
Type | String | Yes | A |
The type of the DNS record. DNS record types dns records types |
Value | String | Yes | 192.0.2.0 |
The value of the DNS record. |
AccessKeyId | String | No | your_accesskey_id |
The AccessKey ID provided to you by Alibaba Cloud. |
Lang | String | No | en |
The language type. |
Line | String | No | default |
The resolution line. Default value: default. |
Priority | Long | No | 1 |
The priority of an MX-type DNS record. Valid values: This parameter must be specified if the type of the DNS record is MX. A smaller value indicates a higher priority. |
TTL | Long | No | 600 |
The TTL of the resolution. Default value: 600. Unit: seconds. |
UserClientIp | String | No | 192.0.2.254 |
The IP address of the client. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RecordId | String | 9999985 |
The ID of the DNS record. |
RequestId | String | 536E9CAD-DB30-4647-AC87-AA5CC38C5382 |
The ID of the request. |
Examples
Sample requests
http(s)://alidns.aliyuncs.com/?Action=AddDomainRecord
&DomainName=example.com
&RR=www
&Type=A
&Value=192.0.2.0
&<Common request parameters>
Sample success responses
XML
format
<AddDomainRecordResponse>
<RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
<RecordId>9999985</RecordId>
</AddDomainRecordResponse>
JSON
format
{
"RecordId":"9999985",
"RequestId":"536E9CAD-DB30-4647-AC87-AA5CC38C5382"
}
Error codes
For a list of error codes, visit the API Error Center.