technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
# Export Blocked Zones

## Endpoint

`/api/blocked/export`

Obsolete path: `/api/exportBlockedZones`

## Method

GET

## Description

Allows exporting all the zones from the Blocked Zones as a text file. The response is a downloadable plain text file, not a JSON response.

## Authentication

Required. A valid session token generated by the `login` or `createToken` call.

## Permissions

Blocked: View

## Parameters

| Name | Type | Required | Conditional | Description |
|------|------|----------|-------------|-------------|
| `token` | string | Yes | No | The session token generated by the `login` or the `createToken` call. |
| `node` | string | No | No | The node domain name for which this API call is intended. When unspecified, the current node is used. This parameter can be used only when Clustering is initialized. |

## Response Fields

This endpoint does NOT return a JSON response. Instead, it returns a downloadable text file.

| Header | Value | Description |
|--------|-------|-------------|
| `Content-Type` | `text/plain` | The response body is plain text. |
| `Content-Disposition` | `attachment` | The browser will treat this as a file download. |

The body contains the list of blocked zone domain names in plain text format.

## Conditional Logic Notes

- The `node` parameter is only functional when Clustering is initialized; otherwise it is ignored or has no effect.
- Unlike all other Blocked Zones endpoints, this one does NOT return a JSON response. The response is a raw text file with download headers.
- This endpoint shares the same "Blocked: View" permission as the list endpoint.

## Edge Cases

- The response format is fundamentally different from all other endpoints in this group -- it is a file download, not JSON. Clients must handle this accordingly (no JSON parsing).
- If there are no blocked zones, the exported file may be empty.
- The exact format of the text file (one domain per line, comma-separated, etc.) is not specified in the docs. Based on the import format using commas, the export may use newline-separated domains (common for zone list files), but this is not guaranteed.
- The `Content-Disposition: attachment` header means browsers will trigger a file download rather than displaying the content inline.
- This is one of only two Blocked Zones endpoints that supports the `node` parameter (the other being `list`).