All Products
Search
Document Center

Alibaba Cloud DNS:DescribeZoneRecords

Last Updated:Dec 02, 2025

You can call DescribeZoneRecords to query DNS records for a zone.

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

pvtz:DescribeZoneRecords

get

*Zone

acs:pvtz::{#accountId}:zone/{#ZoneId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Lang

string

No

The language of the response. Valid values:

  • zh: Chinese.

  • en: English.

Default value: en.

en

Keyword

string

No

The keyword for the hostname. The search is not case-sensitive. Use the SearchMode parameter to switch between a fuzzy search and an exact search. The default is an exact search.

test

ZoneId

string

Yes

The unique ID of the zone.

a96d70eb4ab8ef01503dc5486914****

PageNumber

integer

No

The page number. Pages start from 1. The default value is 1.

1

PageSize

integer

No

The number of entries to return on each page. The maximum value is 100. The default value is 20.

20

UserClientIp

string

No

The client IP address of the user.

127.0.XX.XX

Tag

string

No

The tag. Valid values:

  • ecs: Queries the hostnames that are synchronized from ECS instances to the zone.

  • If you do not specify this parameter, all DNS records in the zone are queried.

ecs

SearchMode

string

No

The search mode. Valid values:

  • LIKE: fuzzy search

  • EXACT: exact search (default)

This parameter is used with the Keyword parameter.

EXACT

Response elements

Element

Type

Description

Example

object

PageSize

integer

The number of entries returned on each page.

100

RequestId

string

The request ID.

7B07FBC3-3A53-4939-A3C6-2BDFE407BAB2

PageNumber

integer

The page number.

1

TotalPages

integer

The total number of pages.

1

TotalItems

integer

The total number of DNS records.

100

Records

object

Record

array<object>

The DNS records.

object

The details of a DNS record.

Status

string

The status of the DNS record. Valid values:

  • ENABLE: enabled

  • DISABLE: paused

ENABLE

Type

string

The type of the DNS record. Valid values:

  • A: maps a domain name to an IPv4 address.

  • AAAA: maps a domain name to an IPv6 address.

  • CNAME: maps a domain name to another domain name.

  • TXT: a text record. The text can be up to 255 characters in length. A TXT record is usually used for Sender Policy Framework (SPF) records to prevent spam.

  • MX: maps a domain name to the IP address of a mail server.

  • PTR: maps an IP address to a domain name.

  • SRV: a service record that specifies the server that provides a specific service.

A

Value

string

The record value.

127.0.XX.XX

Ttl

integer

The time-to-live (TTL) value.

60

Remark

string

The remarks.

test

RecordId

integer

The ID of the DNS record.

246959****

Rr

string

The hostname.

www

Priority

integer

The priority of the MX record.

10

Line

string

The DNS resolution line.

default

Weight

integer

The weight of the record. Valid values: 1 to 100. The default value is 1. DNS requests are distributed to the IP addresses of records based on their weights.

1

CreateTime

string

The time when the DNS record was created.

2019-03-14T03:47Z

UpdateTime

string

The time when the DNS record was last updated.

2023-05-08T02:31Z

CreateTimestamp

integer

The timestamp that indicates when the DNS record was created.

1672740294000

UpdateTimestamp

integer

The timestamp that indicates when the DNS record was last updated.

1654777678000

ZoneId

string

The zone ID.

a49f55537f3b0b1e6e43add0bf5f****

Examples

Success response

JSON format

{
  "PageSize": 100,
  "RequestId": "7B07FBC3-3A53-4939-A3C6-2BDFE407BAB2",
  "PageNumber": 1,
  "TotalPages": 1,
  "TotalItems": 100,
  "Records": {
    "Record": [
      {
        "Status": "ENABLE",
        "Type": "A",
        "Value": "127.0.XX.XX",
        "Ttl": 60,
        "Remark": "test",
        "RecordId": 0,
        "Rr": "www",
        "Priority": 10,
        "Line": "default",
        "Weight": 1,
        "CreateTime": "2019-03-14T03:47Z",
        "UpdateTime": "2023-05-08T02:31Z",
        "CreateTimestamp": 1672740294000,
        "UpdateTimestamp": 1654777678000,
        "ZoneId": "a49f55537f3b0b1e6e43add0bf5f****"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.