technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
# List Cached Zones

## Endpoint

`/api/cache/list`

**Obsolete Path:** `/api/listCachedZones`

## Method

GET

## Description

Lists all cached zones and their DNS records. When called without a `domain` parameter, lists from the cache root (empty string). When called with a specific domain, lists the cached records for that domain. Supports directional browsing to navigate up or down through the zone hierarchy, skipping empty labels.

## Parameters

| Name | Type | Required | Conditional | Description |
|------|------|----------|-------------|-------------|
| `token` | string | Yes | No | The session token generated by the `login` or `createToken` call. |
| `domain` | string | No | No | The domain name to list records for. If omitted, defaults to an empty string (zone root). |
| `direction` | string | No | No | Direction of browsing the zone. Valid values: `up`, `down`. Defaults to `down` when omitted. Allows the server to skip empty labels in the domain name when browsing up or down. |

## Authentication

Required. A valid session token must be provided via the `token` parameter.

## Permissions

Cache: View

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `response.domain` | string | The domain that was queried. |
| `response.zones` | array | List of child zones under the queried domain. May be empty if the domain is a leaf node. |
| `response.records` | array | List of cached DNS records for the domain. |
| `response.records[].name` | string | The fully qualified domain name of the record. |
| `response.records[].type` | string | The DNS record type (e.g., `A`, `AAAA`, `CNAME`, `MX`). |
| `response.records[].ttl` | string | The time-to-live for the record, displayed as both raw seconds and a human-readable duration (e.g., `"283 (4 mins 43 sec)"`). |
| `response.records[].rData` | object | The record data. Structure varies by record type. |
| `response.records[].rData.value` | string | The record value (e.g., an IP address for A records). Present for simple record types. |
| `status` | string | `"ok"` on success. |

## Conditional Logic Notes

- When `domain` is omitted, the server treats it as an empty string, which corresponds to the cache root. This lists top-level cached zones rather than records.
- The `direction` parameter controls hierarchical navigation. `down` drills into subdomains; `up` moves toward the root. The server skips empty labels in either direction.
- The `zones` array will contain child zone entries when browsing non-leaf domains, and will be empty when the queried domain has no child zones.
- The `records` array will be empty if the domain itself has no cached records (but may still have child zones).

## Edge Cases

- Passing a domain that is not in the cache will likely return empty `zones` and `records` arrays rather than an error.
- The `ttl` field is a formatted string combining raw seconds with a human-readable representation, not a pure integer. Parsers must handle this string format.
- The `direction` parameter only accepts `up` or `down`. Behavior with other values is unspecified.
- The `rData` object structure varies depending on the DNS record type; do not assume a fixed schema.