You can call this operation to create a Domain Name System (DNS) record for a private zone.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddZoneRecord

The operation that you want to perform. Set the value to AddZoneRecord.

Rr String Yes www

The prefix of the domain or subdomain name.

For example, you must specify the at sign (@) for this parameter if you want to resolve @.example.com.

Type String Yes A

The type of the DNS record. Valid values: A, CNAME, TXT, MX, and PTR.

Value String Yes 1.1.1.1

The value of the DNS record.

ZoneId String Yes CAgICA1OA_58

The ID of the private zone.

Lang String No en

The language of the specific content returned in the response.

Priority Integer No 5

The priority of the MX record. Valid values: 1 to 99.

Ttl Integer No 60

The amount of time that the DNS resolver caches the value of the DNS record. Default value: 60.

UserClientIp String No 2.2.2.2

The IP address of the client.

Response parameters

Parameter Type Example Description
RecordId Long 5808

The ID of the DNS record.

RequestId String 0B7AD377-7E86-44A8-B9A8-53E8666E72FE

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

Examples

Sample requests

  1. http://pvtz.aliyuncs.com/?Action=AddZoneRecord&ZoneId=CAgICA1OA_58&Rr=www&Type=A&Ttl=60&Value=1.1.1.1&<Common request parameters>

Sample success responses

XML format

  1. <AddZoneRecordResponse> <RecordId>5809</RecordId> <RequestId>D4AD014E-46F6-4311-815B-AAB3ACE06F9C</RequestId></AddZoneRecordResponse>

JSON format

  1. {“RecordId”:5808,“RequestId”:”0B7AD377-7E86-44A8-B9A8-53E8666E72FE”}

Error codes

For a list of error codes, visit the API Error Center.