Get your free beta license ↗
API operation · dns group
POST

/dns/distribution/leave

First published 12 Nov 20260.2.28Unchanged since publication

Leave a DNS distribution network as a node

Who may call it
AdministratorResellerCustomer
Token scope, any of
dnsall
Answers200 OK

Call as an administrator with a token that has the dns scope, on a node in a network of two or three nodes. The only node in a network receives 409 and must stop the network with urbestack-dns-node-stop.

Use as=client to keep sending this server's zones to the network under its existing key. The network continues to serve its customers' zones. Use as=standalone to serve this server's own zones with the nameservers it used before joining. With as=standalone, zones=keep is the default and retains the last published copies on the network. Use zones=delete to remove those copies. The operation returns 400 if as is missing or invalid, or if zones is supplied with an invalid value. UrbeStack applies zones only in standalone mode.

UrbeStack notifies the other nodes. The first remaining node takes over this server's nameserver name, and UrbeStack updates the corresponding DNS records to the new node's IPv4 address and, if available, its IPv6 address. Update the corresponding host record at the registrar. Resolvers can still query this server until the change takes effect. UrbeStack preserves all local zones and continues to serve frozen copies of zones from other nodes and clients with updates disabled. For seven days, it reports the departure and the remaining nodes to servers that contact it. Unreachable nodes learn of the departure the next time they contact this server, and clients switch to the remaining nodes automatically.

The departure has a 240-second time limit. A 200 response includes left set to true, role, as, zones, at, nameservers, the number of frozen zones in frozen_zones, and the notification results in told.

As a command

Run as root on the server

Request body

JSON· 2 fields
asstring, one of client, standaloneRequired
zonesstring, one of keep, delete

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/dns/distribution/leave" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "as": "client",
    "zones": "keep"
  }'
Response · 200 OK
{
  "as": "text",
  "at": "text",
  "frozen_zones": 1,
  "left": true,
  "nameservers": [
    "text"
  ],
  "role": "user",
  "told": [
    {
      "address": "info@example.com",
      "done": true,
      "error": "Domain 'example.com' already exists",
      "host": "text"
    }
  ],
  "zones": "text"
}

Errors

18 errors, each a status and a sentence
400--as client or --as standalone is required
400--delete-frozen stands alone
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid domain name
400Invalid port
400Invalid setting key
400Leaving says what this server becomes: a client of the network, or standalone
400as is client or standalone
400zones is keep or delete
401Authentication required
402This server has no licensed address on record yet: run urbestack-license-check first
404Setting '<key>' not found
409This server holds no frozen zones
409This server is not a node of a distribution network
409This server is the only node of its network, so there is no network to leave. To go back to standalone, stop the network once it has no clients
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.28 on 12 Nov 2026.
urbestack.com/docs/api/post-dns-distribution-leave/