# GET /dns/replace

First published 14 Oct 2026 (release 0.2.0) · Last changed 26 Nov 2026 (release 0.2.35)

UrbeStack release 0.2.35 API operation in the dns group.

Find DNS records or preview a replacement

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

Search every zone, or supply zone to search one. 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. The search includes records regardless of who added them.

Omit to to list matches by zone and record ID. Supply to to preview a replacement. Both modes are read-only. taken marks records UrbeStack maintains for the server, including the nameservers' glue records drawn from the server's identity. These glue records have id null. Replacing a record marked taken makes its record set manually maintained in that zone, as in the zone editor. The kept list shows matching delegations.

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

## As a command

- [urbestack-dns-replace](https://urbestack.com/docs/commands/urbestack-dns-replace.md): Replaces an IP address or hostname across DNS zones, regardless of who added the matching records.

## Parameters

- `from` (query, string, up to 255 characters, required): IPv4 address, IPv6 address, or hostname to find.
- `to` (query, string, up to 255 characters): Replacement value of the same kind as from, with a different value. If omitted or empty, the response lists matching records only.
- `zone` (query, DomainName): DNS zone to search. Omit this parameter to search every zone.

## 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 GET "$API/dns/replace?from=text&to=text&zone=example.com" \
  -H "Authorization: Bearer $TOKEN"
```

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",
  "records": 1,
  "skipped": 1,
  "to": "text",
  "zone": "text",
  "zones": 1
}
```

## Errors

- 400: --from is required
- 400: --to is required, or --find to look only
- 400: A record to leave alone is named by its id, or by ZONE:NAME:TYPE for one the panel writes from the identity, not '<s>'
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Invalid id
- 400: The new value must be 
- 400: The old and the new value are the same
- 400: from is the value to look for: an IPv4 address, an IPv6 address or a host name
- 400: to is the new value: an IPv4 address, an IPv6 address or a host name
- 401: Authentication required
- 404: Zone '<name>' not found

## Change log

Most recent first.

- 0.2.35 · 26 Nov 2026 · Matches now include the server's own records, marked taken. The preview lists the panel hostname's IP address and mail records and the nameservers' glue records alongside other matches. A glue record appears with id null until it is changed.
- 0.2.35 · 26 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 named type [`DnsReplaceChange`](https://urbestack.com/docs/api/types/DnsReplaceChange.md))
- 0.2.0 · 14 Oct 2026 · First published.
