All Products
Search
Document Center

Querying DNS records

Last Updated: Oct 08, 2021

Calls the DescribeDomainRecords operation to query all DNS records of a specified primary domain name based on input parameters.

  • 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 domain names in a list are sorted in descending order of the time they were added.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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.

Direction

String

No

描述

The description of the domain name.

GroupId

Long

No

2223

The ID of the domain name group.

KeyWord

String

No

test

The keyword to specify.

Lang

String

No

en

The language type.

Line

String

No

default

The resolution line. Default value:

default

.

For more information, see

Resolution line enumeration

.

OrderBy

String

No

default

The method that is used to sort the DNS records. DNS records are sorted in descending order of the time they were added.

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

.

RRKeyWord

String

No

www

The keyword of the host record for searches in %RRKeyWord% mode. The value is not case-sensitive.

SearchMode

String

No

LIKE

The search mode. Valid values:

LIKE, EXACT, and ADVANCED

. In LIKE and EXACT modes, you can specify KeyWord for searches. In ADVANCED mode, you can specify other fields for searches.

Status

String

No

Enable

The status of the DNS record. Valid values:

Enable and Disable

.

Type

String

No

A

The type of the DNS record. For more information, see

Resolution record type formats

.

TypeKeyWord

String

No

MX

The keyword of the DNS record type for searches in full match mode. The value is not case-sensitive.

ValueKeyWord

String

No

com

The keyword of the DNS record value for searches in %ValueKeyWord% mode. The value is not case-sensitive.

Response parameters

Parameter

Type

Example

Description

DomainRecords

Array

The list of DNS records.

Record

Details about a DNS record.

DomainName

String

example.com

The domain name.

Line

String

default

The resolution line.

Locked

Boolean

false

The lock status of the DNS record.

Priority

Long

5

The priority of the MX-type DNS record.

RR

String

www

The host record.

RecordId

String

9999985

The ID of the DNS record.

Remark

String

备注

The description of the DNS record.

Status

String

Enable

The status of the DNS record.

TTL

Long

600

The TTL of the resolution.

Type

String

MX

The type of the DNS record.

Value

String

mail1.hichina.com

The value of the DNS record.

Weight

Integer

2

The weight of the DNS record.

PageNumber

Long

1

The page 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

alidns.aliyuncs.com/? Action=DescribeDomainRecords
&DomainName=example.com
& 
 

]]> 
Sample success responses 
XML 
 format 
]]> 
JSON 
 format 
 
536E9CAD-DB30-4647-AC87-AA5CC38C5382 
2 
1 
2 
Error codes 
For a list of error codes, visit the  
API Error Center 
. 
For a list of error codes, visit the  
API Error Center 
. 
example.com 
9999985 
www 
MX 
mail1.hichina.com 
default 
5 
600 
Enable 
false 
example.com 
9999986 
www 
MX 
mail2.hichina.com 
default 
10 
600 
Enable 
false