# DELETE /dns/zones/{name}

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

UrbeStack release 0.2.35 API operation in the dns group.

Delete a server-owned zone or a DNS client's zone

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

Deletes a kept zone, an automatic zone for the web interface hostname or a nameserver, or a zone held for a DNS distribution client. Deletion removes all of the zone's records. This operation refuses zones belonging to a domain or alias. A domain's zone is deleted with the domain.

UrbeStack records the name of a deleted automatic or kept zone in dns.server_zones_removed if it matches an automatic zone name for the web interface hostname or a nameserver. Restore the zone by name with POST /dns/zones or urbestack-dns-zone-add. If the server hosts an enclosing zone, UrbeStack publishes the web interface hostname's IP address and mail records, or the nameserver's IP address records, in the enclosing zone. The response reports the deletion and publication results.

## As a command

- [urbestack-dns-zone-del](https://urbestack.com/docs/commands/urbestack-dns-zone-del.md): Deletes a server-owned DNS zone or a zone held for a DNS distribution client, including all its records.

## Parameters

- `name` (path, DomainName, required)

## 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 DELETE "$API/dns/zones/example.com" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "client": {
    "address": "info@example.com",
    "label": "my laptop"
  },
  "deleted": true,
  "published": true,
  "reload": "text",
  "stays_deleted": true,
  "zone": "text"
}
```

## Errors

- 400: --name is required
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Zone <z.name> belongs to 
- 401: Authentication required
- 404: Zone '<name>' not found
