# Check DNS zone of a domain

> What is wrong or worth knowing in the DNS zone of one domain, in zone text sent or in records to add - nothing is changed.

- Effect: Read - Changes nothing.
- Idempotent: yes
- Stability: stable
- MCP tool: `manitu_domain_dns_zone_check` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/domain/dns/zone/check`
- Needs: `service_domain`
- Page: /reference/domain/dns/zone/check/

## MCP tool

`manitu_domain_dns_zone_check`

### Description for the model

Checks the DNS zone of a domain at manitu, by its name, and lists what is wrong or worth knowing - without changing anything. Pass zone_data to check zone text before [`manitu_domain_dns_zone_set`](/reference/domain/dns/zone/set.md), record_text to check records before adding them, or neither to check the zone as stored. Each finding has a level (error: would be refused; warning, info: a hint), a reason, the record (type, owner, line) and params; is_stored says the record is stored so already - such an error is kept by zone/set, not refused, but should be repaired. refusal_count is how many findings would keep zone/set from storing the text. Only for a zone manitu holds as primary (zone_not_hosted_here otherwise). Read-only.

Reasons it may answer: resource_not_found, permission_missing, zone_not_hosted_here, zone_stored_not_readable.

### Arguments

- `name` (string, required) - The domain name, with international characters or in ASCII. (minLength `1`; maxLength `253`; pattern `"^[^\\x00-,./:-@[-`{-\\x7F]+(?:\\.[^\\x00-,./:-@[-`{-\\x7F]+)+$"`)
- `zone_data` (string) - Optional: the whole zone as BIND zone file text, as [`manitu_domain_dns_zone_set`](/reference/domain/dns/zone/set.md) takes it. Left out (and no record_text): the zone as stored is checked. (minLength `1`; maxLength `524288`)
- `record_text` (string) - Optional, instead of zone_data: records to add, in zone file form, one per line - e.g. "www IN A 192.0.2.1"; names relative to the domain. Checked as if added to the zone as stored. (minLength `1`; maxLength `65536`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_domain_dns_zone_check",
    "arguments": {
      "name": "example.com"
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/domain/dns/zone/check`

### Description

Checks the DNS zone of a domain at manitu, by its name, and lists what is wrong or worth knowing, without changing anything: the zone as stored, the zone text zone_data before [`POST /v1/domain/dns/zone/set`](/reference/domain/dns/zone/set.md), or the records record_text before they are added - one of the two at most (mutually_exclusive). Each finding has a level (error: would be refused; warning, info), a reason, the record (type, owner, line) and params; is_stored says the record is stored so already. refusal_count is the number of findings that would keep the text from being stored. Refused for a zone manitu does not hold as primary (zone_not_hosted_here) or cannot read as stored (zone_stored_not_readable).

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `name` (string, required) - The domain name, with international characters or in ASCII. (minLength `1`; maxLength `253`; pattern `"^[^\\x00-,./:-@[-`{-\\x7F]+(?:\\.[^\\x00-,./:-@[-`{-\\x7F]+)+$"`)
- `zone_data` (string) - Optional: the whole zone as BIND zone file text, as [`POST /v1/domain/dns/zone/set`](/reference/domain/dns/zone/set.md) takes it. Left out (and no record_text): the zone as stored is checked. (minLength `1`; maxLength `524288`)
- `record_text` (string) - Optional, instead of zone_data: records to add, in zone file form, one per line - e.g. "www IN A 192.0.2.1"; names relative to the domain. Checked as if added to the zone as stored. (minLength `1`; maxLength `65536`)

### Response

In `data`; the rest of the body as on every call.

- `name` (string, required) - The domain, with international characters. (maxLength `253`; pattern `"^[^\\x00-,./:-@[-`{-\\x7F]+(?:\\.[^\\x00-,./:-@[-`{-\\x7F]+)+$"`)
- `source` (string, required) - What was checked. (one of `"zone_data"`, `"record_text"`, `"stored"`)
- `refusal_count` (integer, required) - Findings that would keep the text from being stored - errors not stored so already. (minimum `0`)
- `finding_list` (array of object, required) - What was found, by line; findings without line last.
  - `finding_list[].level` (string, required) - (one of `"error"`, `"warning"`, `"info"`)
  - `finding_list[].reason` (string, required) - What was found, lower_snake_case - e.g. ipv4_address_invalid, record_duplicate. (pattern `"^[^\\x00-\\x1F\\x7F]*$"`)
  - `finding_list[].rr_type` (string | null, required) - The record type; null: not tied to a record (a parse error). (pattern `"^[^\\x00-\\x1F\\x7F]*$"`)
  - `finding_list[].owner` (string | null, required) - The name of the record, absolute. (pattern `"^[^\\x00-\\x1F\\x7F]*$"`)
  - `finding_list[].line` (integer | null, required) - The line in the text checked; null: none.
  - `finding_list[].params` (object, required) - The values found - e.g. address, target, value, min, max.
  - `finding_list[].is_stored` (boolean, required) - The record is stored exactly so already.

### Statuses

- `200` Success.
- `400` The input is wrong, or the request itself (INVALID_INPUT). Each entry names its field and its reason - correct the input and call again.
- `401` No credential was presented, or it was not recognised (UNAUTHENTICATED).
- `403` The credential is valid, but may not do this (PERMISSION_DENIED). The reason says why - another credential is the way, not a repeat.
- `404` What the call names does not exist, or not for this caller (NOT_FOUND). Look it up again - do not guess another.
- `409` Not possible in the current state (PRECONDITION_FAILED). The reason says what stands in the way; the same call may succeed once it has changed.
- `429` Too many calls. The Retry-After header says when to try again.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST \
  'https://api.manitu.de/v1/domain/dns/zone/check' \
  -H "X-API-Key: $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"example.com"}'
```

## Example result

```json
{
  "name": "example.com",
  "source": "zone_data",
  "refusal_count": 0,
  "finding_list": [
    {
      "level": "error",
      "reason": "string",
      "rr_type": "string",
      "owner": "string",
      "line": 1,
      "params": {},
      "is_stored": true
    }
  ]
}
```

## Errors

Reasons it is known to fail with - any other may come too; act on the class.

- [`resource_not_found`](/errors/resource_not_found.md) (`NOT_FOUND`) - What the call names does not exist in the account, or not for this access.
- [`permission_missing`](/errors/permission_missing.md) (`PERMISSION_DENIED`) - This access lacks a permission the call needs; the main access of the account can grant it.
- [`zone_not_hosted_here`](/errors/zone_not_hosted_here.md) (`PRECONDITION_FAILED`) - The zone of the domain is not a primary zone held here - its name servers are elsewhere.
- [`zone_stored_not_readable`](/errors/zone_stored_not_readable.md) (`PRECONDITION_FAILED`) - The zone as stored cannot be read; the provider has to repair it.
- [`mutually_exclusive`](/errors/mutually_exclusive.md) (`INVALID_INPUT`) - zone_data and record_text are one or the other.
