AddPrivateZoneRecord
1. API Description
This API (AddPrivateZoneRecord) is used to Add a DNS record to a DNS Zone.
2. Input Parameters
The following request parameter list only provides API request parameters.
zoneId
Yes
String
DNS Zone ID.
recordName
Yes
String
Host record.
Host records are domain prefixes. Common usages include www, @, * (wildcard resolution), and mail (commonly used for email services).
For example, to resolve @.example.com, the host record should be filled with "@" instead of empty.
value
Yes
String
DNS record value.
weight
No
Integer
DNS record weight.
Value range: [1, 100]
Default value: 1
ttl
No
Integer
Domain local cache time.
Unit: seconds, default value: 60, optional value: 5-86400 (one day).
Value range: [5, 86400]
Default value: 60
priority
No
Integer
Priority of MX record.
The smaller the value, the higher the priority. Default value: 1.
Value range: [1, 99]
remark
No
String
Note information.
The length is up to 255 characters.
line
No
String
Request source.
'default' is the default, i.e., Global.
You can also specify a region ID, such as asia-east-1.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request.
RequestId is required for locating a problem.
recordId
String
DNS record ID of a DNS Zone.
4. Code Example
**Add an A record and enable it. **
5. Developer Resources
Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
404
INVALID_PRIVATE_ZONE_NOT_FOUND
DNS Zone does not exist.
400
INVALID_RECORD_VALUE
Invalid record value.
409
INVALID_RECORD_VALUE_CONFLICT
Record value conflict.
404
INVALID_REGION_NOT_FOUND
Region does not exist.
Last updated