dnz backup (CLI) and
/api/backups (API).
Add a target
Settings → Backups → Add target. Each target has its own schedule, retention and encryption: for example hourly to a local disk, and daily, encrypted, to S3.- Folder
- S3-compatible
- SFTP
A folder on the DNZ server: a mounted disk, NFS or SMB share. Absolute, or relative to the data
folder; created if missing. On the same disk as DNZ it is no backup on its own.With Docker, mount it into the container (
-v /var/backups/dnz:/backups) and use /backups.Schedules and retention
Schedules run on the cluster leader, one backup at a time. A backup missed while
DNZ was down runs once it is back. Only DNZ’s own archives (
dnz-backup-…) are ever deleted.
Encryption
With a passphrase, archives (.zip.enc) are sealed with AES-256-GCM, with the key derived by
Argon2id (64 MiB, 3 passes) from the passphrase and a random salt, in 1 MiB chunks so a changed,
reordered or cut-off part is caught.
dnz backup decrypt FILE turns an encrypted archive into the plain zip, without a server.
What’s in an archive
A zip any unzip tool opens:Restore
- Dashboard
- CLI
Settings → Backups → Restore from a file, or Archives → Restore… on a target. Give the
passphrase if it’s encrypted, pick Everything or One zone, and Check what would
change. Restoring everything over a server with data takes typing
RESTORE.1
Dry run
Lists the zones added, removed and changed (with record counts), users added and removed, and the
tables whose row counts change. Nothing is written.
2
Safety copy
Over a server with users or zones, DNZ first saves everything as it is to
<data folder>/backups/pre-restore/ (the newest five stay). Restore that one to undo.3
Replace
Every table is replaced in one transaction: if anything fails, nothing changed. DNS answers,
forwarding and filtering are loaded again, on every node of a cluster, and the GeoIP database and
dnz-proxy state are put back (unless you leave them out).
4
Sign in again
Everyone is signed out: users, roles and API tokens are the backup’s now.
On a new server
Install DNZ with any database. Then either open the dashboard and pick Restore from a backup on the first-run page (no account needed while setup is pending, as for setup itself), or restore before starting DNZ:--offline works on database.url directly. Stop DNZ first; in a cluster, stop every node, restore
once, then start them all.
Across databases and versions
A backup from SQLite restores onto Postgres or MySQL and back. The rows go through a staging SQLite database brought to the backup’s schema version and migrated forward to this DNZ’s, then into the database DNZ runs on; new ids continue after the restored ones. A backup from a newer DNZ is refused: update DNZ first.Every zone as BIND files
Export all zones on the Backups page, Export all on the Zones page (that division), ordnz zone export --all: one zip with a BIND file per zone you can read. A readable copy, not a
backup: no keys, settings or history. See Import and export.
Status and alerts
Each target’s card shows whether the last backup worked, the last good one and its size, the next run, and failures in a row with the error; the recent runs are listed below. A failed backup, and the first good one after, goes to the notification providers with Backup failed (backup_failed). For Prometheus there are dnz_backup_* metrics and the
DnzBackupFailing and DnzBackupOverdue alerts (Prometheus). Targets also
show on the topology map.