Adds a 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 name of the domain or subdomain.

For example, you must specify @ for this parameter if you want to resolve @.example.com.

Type String Yes A

The record type. You can add A, CNAME, TXT, MX, and PTR records to your private zone.

Value String Yes 1.1.1.1

The value of the DNS record.

ZoneId String Yes CAgICA1OA_58

The ID of the zone.

Lang String No en

The language.

Priority Integer No 5

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

Ttl Integer No 60

The time to live (TTL) of the record. Default value: 60.

UserClientIp String No 2.2.XX.XX

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 is successful.

Examples

Sample requests


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

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

JSON format

{
	"RecordId":5808,
	"RequestId":"0B7AD377-7E86-44A8-B9A8-53E8666E72FE"
}

Error codes

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