# List records

URL: https://docs.hanzo.ai/docs/openapi/dns/get-dns-zones-by-zone-records

> Lists the records in one zone.

`GET /v1/dns/zones/{zone}/records`

> [DNS →](https://docs.hanzo.ai/docs/openapi/dns) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                    |
| ------------- | -------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/dns/zones/{zone}/records` |
| **Method**    | `GET`                                              |
| **Operation** | `get_dns_zones_by_zone_records`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`             |

Lists the records in one zone. A provider-backed zone is read from the provider, which is its source of truth. The plane owns the authoritative zone and record store behind every name pointed at Hanzo; this head keeps none of it. The address and the query string ARE the plane's own, relayed verbatim, and the plane's answer comes back unchanged — its status code, its Content-Type, and its Location on a redirect this head never follows.

It travels under the CALLER'S OWN identity and substitutes no service credential, which would collapse tenants: the caller's validated session bearer goes upstream as Authorization and the server-validated org as X-Org-Id, so a caller in one org reaches only that org's zones, exactly as if it had called the plane directly. The upstream host comes only from deployment config, never from the request, so no path can re-target another host.

Fails closed before a byte leaves cloud: no validated principal is 403; an API key is 401, because a pk-/sk- key is not a JWT the OIDC-gated plane can validate and there is no substitute credential to send in its place; a path that normalizes outside /v1/dns, or still carries a percent-escape or a `..` after one decode, is 400; an unconfigured plane is 503 and an unreachable one 502.

## Request

1 field.

| Field  | In   | Type   | Required | Description |
| ------ | ---- | ------ | -------- | ----------- |
| `zone` | path | string | yes      |             |

## Response

The document declares no response body for this operation. It answers `200` on success and the platform error shape on failure — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo dns zones records list <zone>
```

**SDK**

**.ts**

```ts
import { Configuration, DnsApi } from 'hanzoai';

const api = new DnsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getDnsZonesByZoneRecords({ zone: 'zone' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DnsApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DnsApi(client).get_dns_zones_by_zone_records(zone='zone')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DnsAPI.GetDnsZonesByZoneRecords(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, dns_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = dns_api::get_dns_zones_by_zone_records(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DnsApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DnsApi(client).getDnsZonesByZoneRecords();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/dns/zones/<zone>/records \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP declares no tool for **dns** — `tools/list` on `https://api.hanzo.ai/v1/mcp` names the products it does reach. Use HTTP or an SDK.

---

[DNS API](https://docs.hanzo.ai/docs/openapi/dns) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
