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

/dns/replace

First published 14 Oct 20260.2.0Last changed 26 Nov 20260.2.353 changes to view
Latest change (release 0.2.35): Replacement now includes the server's own records.

Replace an IP address or hostname in DNS records

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

Supply distinct from and to values of the same kind. UrbeStack matches whole IPv4 addresses in A records and SPF ip4: terms, whole IPv6 addresses in AAAA records and SPF ip6: terms, and whole hostnames in CNAME, MX, and SRV targets, regardless of who added the records. Use skip with a record ID or with ZONE:NAME:TYPE for a glue record drawn from the server's identity. Replacement includes the records UrbeStack maintains for the server, including its hostname's IP address and mail records and the nameservers' glue records. As in the zone editor, changing one of these records makes its record set manually maintained in that zone. Replacement skips delegations.

Template records that follow dns.ipv4 or dns.ipv6 take the new value and become manually maintained. If another record in the zone already has the same name, type, and new content, UrbeStack removes the old record. Each affected zone gets a new serial and is reloaded.

Supply zone to apply the replacement immediately and receive 200 with the result and publication outcome. Omit zone to queue a dns-replace job that applies the replacement across all zones. That response returns 202 with the job.

After trimming surrounding whitespace, from and to must contain 1 to 255 characters, excluding internal whitespace and U+0000 through U+001F. A missing from or to, a value that fails these checks, or a skip value other than an array or null returns 400.

As commands

Run as root on the server

Request body

JSON ·DnsReplace· 4 fields
fromstring, up to 255 charactersRequired
Value to find, which must be an IPv4 address, an IPv6 address, or a hostname.
tostring, up to 255 charactersRequired
Replacement value, which must be of the same kind as from.
skiparray of value
Records the GET /dns/replace preview listed that the change leaves alone, equivalent to unticking them in the web interface. Use a record ID, or ZONE:NAME:TYPE for a glue record drawn from the server's identity because it has no ID.
Name of the zone to update immediately. Omit this field to apply the replacement across all zones as a job.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/dns/replace" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "text",
    "skip": [
      "text"
    ],
    "to": "text",
    "zone": "example.com"
  }'
Response · 200 OK
{
  "changes": [
    {
      "detached": true,
      "from": "text",
      "id": 1,
      "name": "alice",
      "removed": true,
      "taken": true,
      "to": "text",
      "type": "rebuild",
      "why": "text",
      "zone": "text"
    }
  ],
  "from": "text",
  "kept": [
    {
      "from": "text",
      "id": 1,
      "name": "alice",
      "type": "rebuild",
      "why": "text",
      "zone": "text"
    }
  ],
  "kind": "ipv4",
  "published": true,
  "records": 1,
  "reload": "text",
  "skipped": 1,
  "to": "text",
  "zone": "text",
  "zones": 1
}

Errors

23 errors, each a status and a sentence
400--from is required
400--to is required, or --find to look only
400A new job is queued or running
400A record to leave alone is named by its id, or by ZONE:NAME:TYPE for one the panel writes from the identity, not '<s>'
400Domain name required
400Domain name too long
400Invalid <what>:
400Invalid domain name
400Invalid id
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Job parameters must be an object
400The new value must be
400The old and the new value are the same
400Unknown job type
400Username '<value>' is reserved
400from is the value to look for: an IPv4 address, an IPv6 address or a host name
400skip holds record ids, and ZONE:NAME:TYPE for records the panel writes from the identity, not '<s>'
400skip is a list of record ids, and of ZONE:NAME:TYPE for records the panel writes from the identity
400to is the new value
400to is the new value: an IPv4 address, an IPv6 address or a host name
401Authentication required
404User '<user>' not found
404Zone '<name>' not found

Change log

3 changes since publication, newest first
0.2.3526 Nov 2026
Replacement now includes the server's own records.As in the zone editor, replacing one of these records makes its record set manually maintained in that zone. Use ZONE:NAME:TYPE in skip for a glue record because it has no ID.
0.2.3526 Nov 2026
skip accepts ZONE:NAME:TYPE as well as record IDs.A glue record drawn from the server's identity has no ID, so you can skip it by zone, name and type.From the named type DnsReplace→
0.2.3526 Nov 2026
Added taken and made id nullable.taken marks a record UrbeStack maintains for the server, whose record set becomes manually maintained on replacement. A glue record drawn from the server's identity has id null.From the named type DnsReplaceChange→
0.2.014 Oct 2026
First published.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry last changed in release 0.2.35 on 26 Nov 2026.
urbestack.com/docs/api/post-dns-replace/