> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/zdns/private-zone-record/describeprivatezonerecords.md).

# DescribePrivateZoneRecords

## 1. API Description

This API (DescribePrivateZoneRecords) is used to query the list of DNS records under a specified DNS Zone.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                              | Description                                                                                                                                                |
| -------------- | -------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| zoneId         | Yes      | String                                                            | <p>DNS Zone ID.</p><p>It can be obtained by calling <a href="/api-reference/zdns/private-zone/describeprivatezones.md">DescribePrivateZones</a>.</p>       |
| recordIds      | No       | Array of String                                                   | Filter by DNS record ID.                                                                                                                                   |
| recordName     | No       | String                                                            | Filter by host record.                                                                                                                                     |
| type           | No       | [RecordType](/api-reference/zdns/datastructure.md#recordtype)     | Filter by DNS record type.                                                                                                                                 |
| line           | No       | String                                                            | <p>Filter by the DNS line.</p><p><code>default</code> is the default value, i.e., global.</p><p>You can also specify a region ID, such as asia-east-1.</p> |
| status         | No       | [RecordStatus](/api-reference/zdns/datastructure.md#recordstatus) | Filter by DNS record state.                                                                                                                                |
| value          | No       | String                                                            | Filter by record value.                                                                                                                                    |
| pageSize       | No       | Integer                                                           | <p>The returned page size. Default value: 20; Maximum value: 1000.</p><p>Value range: \[1, 1000]</p>                                                       |
| pageNum        | No       | Integer                                                           | <p>The number of pages returned.</p><p>Value range: \[1, +)</p><p>Default value: 1</p>                                                                     |

## 3. Output Parameters

| Parameter Name | Type                                                                                 | Description                                                                                                           |
| -------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                               | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| totalCount     | Integer                                                                              | The total number of DNS records of the DNS Zone that meet the filtering conditions.                                   |
| dataSet        | Array of [PrivateZoneRecord](/api-reference/zdns/datastructure.md#privatezonerecord) | Returned DNS record list data of the DNS Zone.                                                                        |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the DNS records under a certain DNS Zone.**

```json
POST /api/v2/zdns HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribePrivateZoneRecords
<Common Request Params>

Request：
{
  "zoneId": "<zoneId>"
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
      {
        "recordId": "<recordId>",
        "zoneId": "<zoneId>",
        "type": "A",
        "recordName": "www",
        "value": "10.0.0.1",
        "weight": 10,
        "ttl": 10,
        "line": "default",
        "priority": 0,
        "remark": "Test",
        "status": "Enabled",
        "createTime": "2025-11-17 22:39:22"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                         | Description              |
| ---------------- | ---------------------------------- | ------------------------ |
| 404              | INVALID\_PRIVATE\_ZONE\_NOT\_FOUND | DNS Zone does not exist. |
