AddDomainRecord

Last Updated: Dec 08, 2017

Description

Resolution records are added based on input parameters. For more information, see Resolution record type formats, Resolution record type constraints, and Rules for determining conflicting resolution records.

Request parameters

Name Type Required? Description
Action String Yes AddDomainRecord.
DomainName String Yes Domain name.
RR String Yes Host record. For example, to resolve @.example.com, use @.
Type String Yes Resolution record type. For more information, see Resolution record type formats.
Value String Yes Record value.
TTL Long No Time to live. Default value: 600 seconds (10 minutes). For more information, see TTL definition description.
Priority Long No MX record priority. Value range: [1,10]. This parameter is required when the record type is MX.
Line String No Resolution line. Default value: default. For more information, see Resolution line enumeration.

Return parameters

For more information about public return parameters, see Public Return Parameters.

Name Type Description
RequestId String Unique request identifier
RecordId String Resolution record ID

Error codes

For errors common to all interfaces, see Error code table.

Error Code Description HTTP Status Code Meaning
IncorrectDomainUser The domain name does not belong to this user. 400 The domain name does not exist under this account.
DomainRecordDuplicate The domain record is duplicated. 400 The resolution record does not exist.
DomainRecordConflict The domain record is conflict with other records. 400 Resolution record conflicts.
QuotaExceeded.Record You cannot add this domain record because the maximum number of {“Type RR Line”} record (90) is exceeded. 400 The maximum of 90 resolution records per type is exceeded.
QuotaExceeded.ARecord You cannot add this domain record because the maximum number of {“Type RR Line”} record is exceeded. 400 The maximum number of A(AAAA) record is exceeded.
RecordForbidden.BlackHole The action cannot be completed because some records are in black holes. 400 Some resolution records are in black holes.
DomainForbidden The action cannot be completed because the domain name is forbidden. 400 The resolution operation is forbidden on this domain name.
UnKnownError An unknown error occurs. 400 Unknown error.
URLForwardError.PanRecord The wildcard record is not supported in URL forward record. 400 URL forwarding does not support wildcard resolution records.
URLForwardError.NotDefaultLine The URL forward record only supports default line. 400 URL forwarding is not default line.
URLForwardError. ChineseChar The Chinese character is not supported in URL forward record. 400 The target domain name for URL forwarding is a Chinese domain name.
URLForwardError.NotVerifyDomain The domain name must be verified in Hichina in URL forward record. 400 The URL forwarding domain name is not filed.
QuotaExceeded.URLRecord The maximum number of URL record is exceeded. 400 The URL forwarding quantity exceeds the limit.
QuotaExceeded.SubDomain The maximum number of subdomain levels is exceeded. 400 The subdomain name levels exceed the limit.
QuotaExceeded.TTL TTL parameter is out of range. 400 The TTL time exceeds the limit.
UnsupportedLine This line is not be supported in the current DNS version. 400 The current version does not support this resolution line.
RecordForbidden.DNSChange The action cannot be completed because DNS is changing. 400 This operation is forbidden due to DNS migration.

Example

Request example

  1. http://dns.aliyuncs.com/?Action=AddDomainRecord
  2. &DomainName=example.com
  3. &RR=www
  4. &Type=A
  5. &Value=202.106.0.20
  6. &TTL=600
  7. &Line=default
  8. &<Public Request Parameters>

Return example

  • XML format
  1. <AddDomainRecordResponse>
  2. <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
  3. <RecordId>9999985</RecordId>
  4. </AddDomainRecordResponse>
  • JSON example
  1. {
  2. "RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
  3. "RecordId": "9999985"
  4. }
Thank you! We've received your feedback.