All Products
Search
Document Center

Alibaba Cloud DNS:DescribeDomainRecords

Last Updated:Dec 16, 2025

Retrieves the DNS records for a specified root domain based on the input parameters.

Operation description

  • You can specify the domain name (DomainName), page number (PageNumber), and page size (PageSize) to retrieve a list of DNS records.

  • You can specify a keyword for the host record (RRKeyWord), record type (TypeKeyWord), or record value (ValueKeyWord) to query DNS records that contain the keyword.

  • By default, DNS records are sorted in descending order by the time they were added.

  • You can specify a domain group ID (GroupId) to query the DNS records in a specific group.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

alidns:DescribeDomainRecords

get

*Domain

acs:alidns::{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

Lang

string

No

The language of the request and response. Default value: zh. Valid values:

  • zh: Chinese

  • en: English

en

DomainName

string

Yes

The domain name. For more information, see DescribeDomains.

example.com

PageNumber

integer

No

The page number. The value starts from 1. Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page for a paged query. Maximum value: 500. Default value: 20.

20

KeyWord

string

No

The keyword.

test

RRKeyWord

string

No

The keyword for the host record. The search uses a fuzzy match pattern and is not case-sensitive.

www

TypeKeyWord

string

No

The keyword for the record type. The search uses an exact match and is not case-sensitive.

MX

ValueKeyWord

string

No

The keyword for the record value. The search uses a fuzzy match pattern and is not case-sensitive.

com

OrderBy

string

No

The sorting method. Records are sorted in descending order based on the time they were added.

default

Direction

string

No

The sorting direction. Valid values: DESC, ASC. Default value: DESC.

DESC

SearchMode

string

No

The search mode. Valid values: LIKE, EXACT, ADVANCED, and COMBINATION.

  • If you set this parameter to LIKE or EXACT, use the KeyWord parameter. The RRKeyWord, TypeKeyWord, ValueKeyWord, Type, Line, and Status parameters are invalid.

  • If you set this parameter to ADVANCED, use the RRKeyWord, TypeKeyWord, ValueKeyWord, Type, Line, and Status parameters. The RRKeyWord and ValueKeyWord parameters support fuzzy matching.

  • If you set this parameter to COMBINATION, use the RRKeyWord, TypeKeyWord, ValueKeyWord, Type, Line, and Status parameters. All these parameters support only exact matching.

  • If you do not specify this parameter:
    • If you specify the keyWord parameter, the search mode is set to LIKE.

    • If you do not specify the keyWord parameter, RRKeyWord and ValueKeyWord support fuzzy matching, and TypeKeyWord, Type, Line, and Status support exact matching.

LIKE

GroupId

integer

No

The ID of the domain group.

  • If you do not specify GroupId, the query is performed on all domain names.

  • If you set GroupId to 0, an empty result is returned.

  • If you set GroupId to -1, the query is performed on the default group. The default group includes domain names that are not assigned to a group.

  • If you set GroupId to -2, the query is performed on all domain names.

  • If you specify another value for GroupId, the query is performed on the specified group. For more information, see DescribeDomainGroups.

2****

Type

string

No

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

DNS record types

A

Line

string

No

The DNS resolution line. Default value: default.

For more information, see:

Enumeration of DNS resolution lines

cn_mobile_anhui

Status

string

No

The status of the DNS record. Valid values:

Enable: The DNS record is enabled.

Disable: The DNS record is paused.

Enable

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of DNS records.

2

PageSize

integer

The number of DNS records returned in this query.

20

RequestId

string

The request ID.

536E9CAD-DB30-4647-AC87-AA5CC38C5382

DomainRecords

object

Record

array<object>

The list of DNS records.

object

Status

string

The status of the DNS record.

Enable

Type

string

The record type.

MX

Remark

string

The remarks.

备注

TTL

integer

The time to live (TTL). Unit: seconds.

600

RecordId

string

The ID of the DNS record.

9*******

Priority

integer

The priority of the MX record.

5

RR

string

The host record.

www

DomainName

string

The domain name.

example.com

Weight

integer

The weight for load balancing.

2

Value

string

The record value.

mail1.hichina.com

Line

string

The DNS resolution line.

default

Locked

boolean

The lock status of the DNS record.

false

CreateTimestamp

integer

The time when the record was created. This is a UNIX timestamp.

1666501957000

UpdateTimestamp

integer

The time when the record was last updated. This is a UNIX timestamp.

1676872961000

LbaStatus

boolean

Indicates whether a load balancing policy is configured.

  • true: Weight-based

  • false: Polling-based

true

PageNumber

integer

The current page number.

1

Examples

Success response

JSON format

{
  "TotalCount": 2,
  "PageSize": 20,
  "RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
  "DomainRecords": {
    "Record": [
      {
        "Status": "Enable",
        "Type": "MX",
        "Remark": "备注",
        "TTL": 600,
        "RecordId": "9*******",
        "Priority": 5,
        "RR": "www",
        "DomainName": "example.com",
        "Weight": 2,
        "Value": "mail1.hichina.com",
        "Line": "default",
        "Locked": false,
        "CreateTimestamp": 1666501957000,
        "UpdateTimestamp": 1676872961000,
        "LbaStatus": true
      }
    ]
  },
  "PageNumber": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.