edit-icon download-icon

Getting started example

Last Updated: Dec 11, 2017

Retrieve a domain name list

When retrieving a domain name list (DescribeDomains), you can use the following optional parameters: page number (PageNumber), number of domain names per page (PageSize), and keywords (KeyWord).

Request example

  1. http://dns.aliyuncs.com/?Action=DescribeDomains
  2. &PageNumber=1
  3. &PageSize=20
  4. &KeyWord=com
  5. &<Public Request Parameters>

Return example

  1. <DescribeDomainsResponse>
  2. <RequestId>6393C3A8-B611-42F2-AFA6-F080FC45D5D0</RequestId>
  3. <TotalCount>2</TotalCount>
  4. <PageNumber>1</PageNumber>
  5. <PageSize>2</PageSize>
  6. <Domains>
  7. <Domain>
  8. <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
  9. <DomainName>abc.com</DomainName>
  10. <PunyCode>abc.com</PunyCode>
  11. <DnsServers>
  12. <DnsServer>dns1.hichina.com</DnsServer>
  13. <DnsServer>dns2.hichina.com</DnsServer>
  14. </DnsServers>
  15. </Domain>
  16. <Domain>
  17. <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
  18. <DomainName>Instance.com</DomainName>
  19. <PunyCode>xn--fsq270a.com</PunyCode>
  20. <DnsServers>
  21. <DnsServer>dns1.hichina.com</DnsServer>
  22. <DnsServer>dns2.hichina.com</DnsServer>
  23. </DnsServers>
  24. </Domain>
  25. </Domains>
  26. </DescribeDomainsResponse>

Add domains

To add domains (AddDomain), you must specify the expected domain names (DomainName).

Request example

  1. http://dns.aliyuncs.com/?Action=AddDomain
  2. &DomainName=example.com
  3. &<Public Request Parameters>

Return example

  1. <AddDomainResponse>
  2. <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
  3. <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
  4. <DomainName>example.com</DomainName>
  5. <PunyCode>example.com</PunyCode>
  6. <DnsServers>
  7. <DnsServer>dns1.hichina.com</DnsServer>
  8. <DnsServer>dns2.hichina.com</DnsServer>
  9. </DnsServers>
  10. </AddDomainResponse>

Retrieve the resolution records list

To retrieve the resolution records list (DescribeDomainRecords), you must specify the expected domain name (DomainName). You can also use the following optional parameters: page number (PageNumber), domain names per page (PageSize), host record keywords (RRKeyWord), resolution type keywords (TypeKeyWord), and record value keywords (ValueKeyWord).

Request example

  1. http://dns.aliyuncs.com/?Action=DescribeDomainRecords
  2. &DomainName=example.com
  3. &PageNumber=1
  4. &PageSize=20
  5. &RRKeyWord=www
  6. &TypeKeyWord=MX
  7. &ValueKeyWord=com
  8. &<Public Request Parameters>

Return example

  1. <DescribeDomainRecordsResponse>
  2. <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
  3. <TotalCount>2</TotalCount>
  4. <PageNumber>1</PageNumber>
  5. <PageSize>2</PageSize>
  6. <DomainRecords>
  7. <Record>
  8. <DomainName>example.com</DomainName>
  9. <RecordId>9999985</RecordId>
  10. <RR>www</RR>
  11. <Type>MX</Type>
  12. <Value>mail1.hichina.com</Value>
  13. <Line>default</Line>
  14. <Priority>5</Priority>
  15. <TTL>600</TTL>
  16. </Record>
  17. <Record>
  18. <DomainName>example.com</DomainName>
  19. <RecordId>9999986</RecordId>
  20. <RR>www</RR>
  21. <Type>MX</Type>
  22. <Value>mail2.hichina.com</Value>
  23. <Line>default</Line>
  24. <Priority>10</Priority>
  25. <TTL>600</TTL>
  26. </Record>
  27. </DomainRecords>
  28. </DescribeDomainRecordsResponse>

Add resolution records

To add resolution records (AddDomainRecord), you must specify the following parameters: domain name (DomainName), host record (RR), record type (Type), and record value (Value). You can also use the following optional parameters: resolution line (Line), MX priority (Priority), and TTL.

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

  1. <AddDomainRecordResponse>
  2. <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
  3. <RecordId>9999985</RecordId>
  4. </AddDomainRecordResponse>
Thank you! We've received your feedback.