# Reset DNS zone of a domain

> Put the DNS zone of a domain back to the records its web hosting package sets up.

- Effect: Destructive - Removes something for good. Agents ask first.
- Idempotent: yes
- Stability: beta
- MCP tool: `manitu_domain_dns_zone_reset` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/domain/dns/zone/reset`
- Needs: `service_domain`
- Page: /reference/domain/dns/zone/reset/

**Removes something for good. Agents name what will be lost and wait for an explicit yes; a program should ask the same.**

## MCP tool

`manitu_domain_dns_zone_reset`

### Description for the model

Puts the DNS zone of a domain at manitu back to the records its web hosting package sets up for web site and e-mail - for a zone that was broken by hand. mode replace makes it a new zone: every other record (own servers, TXT for verifications, ...) is gone. mode merge puts manitu's records in and keeps the others. A custom MX and A/AAAA of the domain itself are kept where they can be. Read the zone first (manitu_domain_dns_zone_get), tell the customer what will be lost, and wait for an explicit yes. Only for a domain in a web hosting package (else conflict no_webhosting_package); refused with a conflict when manitu does not hold the zone (zone_not_primary_at_manitu), the domain is not active (zone_not_editable) or the zone changed since zone_revision (zone_changed). Every change counts the serial up and answers the new zone_revision - pass that one with the next change. A new serial after your own change is expected, not a change by someone else.

### Arguments

- `name` (string, required) - The domain name, with international characters or in ASCII. (minLength `1`; maxLength `253`)
- `mode` (string, required) - replace: the zone as a new one, every other record is gone. merge: manitu's records for web and mail put in, the other records kept. (one of `"replace"`, `"merge"`)
- `zone_revision` (string) - Optional: zone_revision from manitu_domain_dns_zone_get or from the answer of your last change - refused with zone_changed if the zone changed since. (pattern `"^[0-9a-f]{64}$"`)

### Example

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

## REST

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

### 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`)
- `mode` (string, required) - replace: the zone as a new one, every other record is gone. merge: manitu's records for web and mail put in, the other records kept. (one of `"replace"`, `"merge"`)
- `zone_revision` (string) - Optional: zone_revision from manitu_domain_dns_zone_get or from the answer of your last change - refused with zone_changed if the zone changed since. (pattern `"^[0-9a-f]{64}$"`)

### Response

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

- `name` (string, required) - The domain, with international characters.
- `mode` (string, required) - (one of `"replace"`, `"merge"`)
- `zone_data` (string, required) - The zone now, as BIND zone file text (raw).
- `zone_revision` (string, required) - The revision of the zone now.

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `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/reset' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name":"example.com","mode":"replace"}'
```

## Example result

```json
{
  "name": "example.com",
  "mode": "replace",
  "zone_data": "string",
  "zone_revision": "string"
}
```
