Getting Started Example

Last Updated: May 27, 2016

Step 1: Retrieve a Domain Name List

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

Request Example

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

Return Example

<DescribeDomainsResponse>
    <RequestId>6393C3A8-B611-42F2-AFA6-F080FC45D5D0</RequestId>
    <TotalCount>2</TotalCount>
    <PageNumber>1</PageNumber>
    <PageSize>2</PageSize>
    <Domains>
        <Domain>
            <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
            <DomainName>abc.com</DomainName>
            <PunyCode>abc.com</PunyCode>
            <DnsServers>
                <DnsServer>dns1.hichina.com</DnsServer>
                <DnsServer>dns2.hichina.com</DnsServer>
            </DnsServers>
        </Domain>
        <Domain>
            <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
            <DomainName>Instance.com</DomainName>
            <PunyCode>xn--fsq270a.com</PunyCode>
            <DnsServers>
                <DnsServer>dns1.hichina.com</DnsServer>
                <DnsServer>dns2.hichina.com</DnsServer>
            </DnsServers>
        </Domain>
    </Domains>
</DescribeDomainsResponse>

Step 2: Add Domains

To add domains (AddDomain), the user must specify the desired domain names (DomainName).

Request Example

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

Return Example

<AddDomainResponse>
    <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
    <DomainId>00efd71a-770e-4255-b54e-6fe5659baffe</DomainId>
    <DomainName>example.com</DomainName>
    <PunyCode>example.com</PunyCode>
    <DnsServers>
        <DnsServer>dns1.hichina.com</DnsServer>
        <DnsServer>dns2.hichina.com</DnsServer>
    </DnsServers>
</AddDomainResponse>

Step 3: Retrieve the Resolution Records List

To retrieve the resolution records list (DescribeDomainRecords), the user must specify the desired domain name (DomainName). The user 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

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

Return Example

<DescribeDomainRecordsResponse>
    <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
    <TotalCount>2</TotalCount>
    <PageNumber>1</PageNumber>
    <PageSize>2</PageSize>
    <DomainRecords>
        <Record>
            <DomainName>example.com</DomainName>
            <RecordId>9999985</RecordId>
            <RR>www</RR>
            <Type>MX</Type>
            <Value>mail1.hichina.com</Value>
            <Line>default</Line>
            <Priority>5</Priority>
            <TTL>600</TTL>
        </Record>
        <Record>
            <DomainName>example.com</DomainName>
            <RecordId>9999986</RecordId>
            <RR>www</RR>
            <Type>MX</Type>
            <Value>mail2.hichina.com</Value>
            <Line>default</Line>
            <Priority>10</Priority>
            <TTL>600</TTL>
        </Record>
    </DomainRecords>
</DescribeDomainRecordsResponse>

Step 4: Add Resolution Records

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

Request Example

http://dns.aliyuncs.com/?Action=AddDomainRecord
&DomainName=example.com
&RR=www
&Type=A
&Value=202.106.0.20
&TTL=600
&Line=default
&<Public Request Parameters>

Return Example

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