# POST /domains/{name}/dns/reset

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the dns group.

Reset a DNS zone to its template

- Who may call it: administrator, reseller, customer
- Token scope, any of: dns, all
- Answers: 200 OK

The reset replaces the zone's own records with records from its template, excluding subdomain records and delegations to other zones.

If zone is omitted or empty, the request targets the domain's own zone. Set zone to an alias name to target its zone. An unrelated zone name returns 404. Targeting a subdomain's own zone returns 400. The parent domain's zone holds the subdomain's records.

For customer and reseller requests, UrbeStack verifies that the zone still belongs to the domain's customer when it resets the zone. The response includes the zone name, the counts of records removed and restored, the resulting records, and the publication status.

## As a command

- [urbestack-dns-zone-reset](https://urbestack.com/docs/commands/urbestack-dns-zone-reset.md): Resets a DNS zone by replacing its own records with records from the zone template.

## Parameters

- `name` (path, DomainName, required)

## Request body

JSON, the type [DnsReset](https://urbestack.com/docs/api/types/DnsReset.md).

- `zone` (string, up to 254 characters)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/domains/example.com/dns/reset" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "zone": "text"
  }'
```

Response, 200 OK:

```
{
  "published": true,
  "records": [
    {
      "content": "text",
      "created_at": "2026-09-09T10:15:00Z",
      "id": 1,
      "managed_key": "text",
      "name": "alice",
      "origin": "yours",
      "priority": 1,
      "server": true,
      "system": true,
      "ttl": 1,
      "type": "A"
    }
  ],
  "reload": "text",
  "removed": 1,
  "restored": 1,
  "zone": "text"
}
```

## Errors

- 400: --zone is required
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Records for a subdomain live in the zone of <parent>
- 401: Authentication required
- 404: <name> is neither this domain nor one of its other names
- 404: Zone '<name>' not found
