# urbestack-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 command, run as root in the server shell.

## Usage

```
urbestack-dns-replace --from OLD --to NEW [--zone ZONE] [--skip ID|ZONE:NAME:TYPE]... [--dry-run]
urbestack-dns-replace --from OLD [--zone ZONE] --find
```

## Description

Replaces an IP address or hostname across DNS zones, regardless of who added the matching records. It 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. --to must differ from --from and be of the same kind.

Template records that follow dns.ipv4 or dns.ipv6 take the new value and become manually maintained. Replacement also includes records UrbeStack writes from the server's identity, including the panel 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. UrbeStack stops updating the record set until you give it back. Replacement skips delegations. 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.

Use --zone to limit the search to one zone. Repeat --skip with the ID of each record to exclude. For a glue record drawn from the server's identity, use ZONE:NAME:TYPE because it has no ID. Use --dry-run to preview a replacement before applying it. Use --find with --from for a read-only list of matches by zone and record ID. taken marks records UrbeStack maintains for the server. The kept list shows matching delegations.

## Same in the API

- [GET /dns/replace](https://urbestack.com/docs/api/get-dns-replace.md): Find DNS records or preview a replacement
- [POST /dns/replace](https://urbestack.com/docs/api/post-dns-replace.md): Replace an IP address or hostname in DNS records
- [POST /dns/replace](https://urbestack.com/docs/api/post-dns-replace.md): Replace an IP address or hostname in DNS records

## Command family: dns

- [urbestack-dns-challenge-add](https://urbestack.com/docs/commands/urbestack-dns-challenge-add.md): Publishes a TXT record for certificate validation and confirms that DNS serves the value before reporting success.
- [urbestack-dns-challenge-del](https://urbestack.com/docs/commands/urbestack-dns-challenge-del.md): Removes DNS validation TXT records for the certificate job specified by --job and republishes the affected zones.
- [urbestack-dns-challenge-purge](https://urbestack.com/docs/commands/urbestack-dns-challenge-purge.md): Removes all expired DNS validation records and republishes the affected zones.
- [urbestack-dns-check](https://urbestack.com/docs/commands/urbestack-dns-check.md): Compares the hashes of this server's DNS zones with those reported by each node in its DNS distribution network.
- [urbestack-dns-client-add](https://urbestack.com/docs/commands/urbestack-dns-client-add.md): Registers another UrbeStack server as a client of this DNS server and issues a key.
- [urbestack-dns-client-del](https://urbestack.com/docs/commands/urbestack-dns-client-del.md): Removes the DNS client at the IPv4 address given by --address and revokes its key.
- [urbestack-dns-client-hand](https://urbestack.com/docs/commands/urbestack-dns-client-hand.md): Transfers a zone held for one DNS client to a different registered client.
- [urbestack-dns-client-key](https://urbestack.com/docs/commands/urbestack-dns-client-key.md): Replaces only the key for an existing DNS client, for example if the key was lost.
- [urbestack-dns-client-list](https://urbestack.com/docs/commands/urbestack-dns-client-list.md): Lists this DNS server's clients with their IPv4 addresses, labels, zone counts, last call times and any recorded reason for refusal.
- [urbestack-dns-client-note](https://urbestack.com/docs/commands/urbestack-dns-client-note.md): Records when a DNS client last called the API using its key.
- [urbestack-dns-client-receive](https://urbestack.com/docs/commands/urbestack-dns-client-receive.md): Applies DNS zone and network updates sent through the API by a client or node.
- [urbestack-dns-client-report](https://urbestack.com/docs/commands/urbestack-dns-client-report.md): Reports the state of every zone held on this DNS server for the client at --address, for the client's API sync check.
- [urbestack-dns-client-set](https://urbestack.com/docs/commands/urbestack-dns-client-set.md): Renames the DNS client at the IPv4 address given by --address.
- [urbestack-dns-connect](https://urbestack.com/docs/commands/urbestack-dns-connect.md): Connects this server as a client of a DNS distribution network so the network's UrbeStack nodes can serve this server's zones.
- [urbestack-dns-disconnect](https://urbestack.com/docs/commands/urbestack-dns-disconnect.md): Disconnects this server from its DNS distribution network, discards the key and stops zone updates and the retry timer.
- [urbestack-dns-nameserver](https://urbestack.com/docs/commands/urbestack-dns-nameserver.md): Moves or drops a nameserver in this server's DNS distribution network.
- [urbestack-dns-node-add](https://urbestack.com/docs/commands/urbestack-dns-node-add.md): Registers another UrbeStack server as a node of this server's DNS distribution network and issues a joining key.
- [urbestack-dns-node-join](https://urbestack.com/docs/commands/urbestack-dns-node-join.md): Joins this server to a DNS distribution network as a node.
- [urbestack-dns-node-leave](https://urbestack.com/docs/commands/urbestack-dns-node-leave.md): Removes this server from its DNS distribution network and notifies the other nodes.
- [urbestack-dns-node-list](https://urbestack.com/docs/commands/urbestack-dns-node-list.md): Lists the nodes in this server's DNS distribution network.
- [urbestack-dns-node-start](https://urbestack.com/docs/commands/urbestack-dns-node-start.md): Starts a DNS distribution network with this server as its first node.
- [urbestack-dns-node-stop](https://urbestack.com/docs/commands/urbestack-dns-node-stop.md): Stops this server's DNS distribution network.
- [urbestack-dns-push](https://urbestack.com/docs/commands/urbestack-dns-push.md): Sends pending zone updates and deletions to this server's DNS distribution nodes.
- [urbestack-dns-record-add](https://urbestack.com/docs/commands/urbestack-dns-record-add.md): Adds a record to a DNS zone.
- [urbestack-dns-record-del](https://urbestack.com/docs/commands/urbestack-dns-record-del.md): Deletes a DNS record from the specified zone by its ID.
- [urbestack-dns-record-set](https://urbestack.com/docs/commands/urbestack-dns-record-set.md): Changes a DNS record in a zone.
- [urbestack-dns-status](https://urbestack.com/docs/commands/urbestack-dns-status.md): Shows this server's DNS distribution status, as in the Distribution nodes tab of the web interface.
- [urbestack-dns-take](https://urbestack.com/docs/commands/urbestack-dns-take.md): Transfers control of a DNS record set that UrbeStack generates to the administrator.
- [urbestack-dns-ttl-set](https://urbestack.com/docs/commands/urbestack-dns-ttl-set.md): Changes only the TTL on individually editable records in a zone.
- [urbestack-dns-zone-add](https://urbestack.com/docs/commands/urbestack-dns-zone-add.md): Creates a server-owned DNS zone for the administrator to manage independently of a domain or alias.
- [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.
- [urbestack-dns-zone-get](https://urbestack.com/docs/commands/urbestack-dns-zone-get.md): Shows a DNS zone's details and stored records.
- [urbestack-dns-zone-list](https://urbestack.com/docs/commands/urbestack-dns-zone-list.md): Lists the DNS zones this server is authoritative for.
- [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.

## Change log

Most recent first.

- 0.2.35 · 26 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 with --skip for a glue record because it has no ID.
- 0.2.0 · 14 Oct 2026 · First published.
