Queries the DNS records of a specified domain name.
- You can specify the DomainName, PageNumber, and PageSize parameters to query the DNS records of a domain name.
- You can also specify the RRKeyWord, TypeKeyWord, or ValueKeyWord parameter to query the DNS records that contain the specified keyword.
- By default, the DNS records are sorted in reverse chronological order based on the time when they were added.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeDomainRecords |
The operation that you want to perform. Set the value to DescribeDomainRecords. |
DomainName | String | Yes | example.com |
The domain name for which you want to query DNS records. |
GroupId | Long | No | 2223 |
The ID of the domain name group. |
SearchMode | String | No | LIKE |
The search mode. Valid values: LIKE, EXACT, and ADVANCED.
|
KeyWord | String | No | test |
The keyword based on which the system queries DNS records. |
RRKeyWord | String | No | www |
The resource record (RR) keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in fuzzy match mode. The value is not case-sensitive. |
TypeKeyWord | String | No | MX |
The type keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in exact match mode. The value is not case-sensitive. |
ValueKeyWord | String | No | com |
The record value keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in fuzzy match mode. The value is not case-sensitive. |
Type | String | No | A |
The type of the DNS records to query. For more information, see the following topic: |
Line | String | No | default |
The line based on which the system queries DNS records. Default value: default. For more information, see the following topic:
|
OrderBy | String | No | default |
The method that is used to sort the returned DNS records. By default, the DNS records are sorted in reverse chronological order based on the time when they were added. |
Direction | String | No | DESC |
The order in which the returned DNS records are sorted. Valid values: DESC and ASC. Default value: DESC. |
Status | String | No | Enable |
The status of the DNS records to query. Valid values: Enable and Disable. |
PageNumber | Long | No | 1 |
The number of the page to return. Pages start from page 1. Default value: 1. |
PageSize | Long | No | 20 |
The number of entries to return on each page. Maximum value: 500. Default value: 20. |
Lang | String | No | en |
The language of the domain name. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DomainRecords | Array of Record |
The DNS records returned. |
|
Record | |||
DomainName | String | example.com |
The domain name to which the DNS record belongs. |
Line | String | default |
The line that is used by the DNS record. |
Locked | Boolean | false |
Indicates whether the DNS record is locked. |
Priority | Long | 5 |
The priority of the MX record. |
RR | String | www |
The RR value. |
RecordId | String | 9999985 |
The ID of the DNS record. |
Remark | String | Remarks |
The description of the DNS record. |
Status | String | Enable |
The status of the DNS record. |
TTL | Long | 600 |
The time-to-live (TTL) of the DNS record. |
Type | String | MX |
The type of the DNS record. |
Value | String | mail1.hichina.com |
The record value. |
Weight | Integer | 2 |
The weight of the DNS record. |
PageNumber | Long | 1 |
The number of the returned page. |
PageSize | Long | 2 |
The number of entries returned per page. |
RequestId | String | 536E9CAD-DB30-4647-AC87-AA5CC38C5382 |
The ID of the request. |
TotalCount | Long | 2 |
The total number of DNS records. |
Examples
Sample requests
http(s)://alidns.aliyuncs.com/?Action=DescribeDomainRecords
&DomainName=example.com
&<Common request parameters>
Sample success responses
XML
format
<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>
<Status>Enable</Status>
<Locked>false</Locked>
</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>
<Status>Enable</Status>
<Locked>false</Locked>
</Record>
</DomainRecords>
</DescribeDomainRecordsResponse>
JSON
format
{
"RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
"TotalCount": 2,
"PageNumber": 1,
"PageSize": 2,
"DomainRecords": {
"Record": [
{
"DomainName": "example.com",
"RecordId": "9999985",
"RR": "www",
"Type": "MX",
"Value": "mail1.hichina.com",
"Line": "default",
"Priority": 5,
"TTL": 600,
"Status": "Enable",
"Locked": false
},
{
"DomainName": "example.com",
"RecordId": "9999986",
"RR": "www",
"Type": "MX",
"Value": "mail2.hichina.com",
"Line": "default",
"Priority": 10,
"TTL": 600,
"Status": "Enable",
"Locked": false
}
]
}
}
Errors
For a list of error codes, visit the API Error Center.