# Archive DNS records to R2 on a schedule

Save a dated BIND zone file in a private R2 bucket. Use it to review changes or recover individual DNS records.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=cloudflare-dns-zone-exports-to-r2&templateName=Archive+DNS+records+to+R2+on+a+schedule)

**Required accounts**

- Cloudflare DNS
- Cloudflare R2

## Archive DNS records to R2 on a schedule

### 1. Trigger · Daily schedule

**Schedule**. Run automatically on the configured schedule.

### 2. Action · Export the selected DNS records

**Cloudflare DNS**. Save matching DNS records as a BIND file, ready to compare or archive.

### 3. Action · Save the dated zone file

**Cloudflare R2**. Run the R2 S3-compatible PutObject operation.

## Set up your workflow

1. **Set the schedule** Choose a backup time and connect Cloudflare with read access to the source zone. Pick that zone in the export step.
2. **Select the archive scope** Leave record filters empty for a whole-zone export or enter a name or suffix. Disable generated records when you only want matching stored records.
3. **Choose the backup bucket** Connect R2 and select a private writable bucket. The object key includes the scheduled timestamp so earlier archives remain available.
4. **Inspect an archive** Run the workflow and download the .zone object from dns-backups/. Look for a known record and verify its type and value before using the file for recovery.

## Related integrations

- [Schedule trigger](https://www.fasthook.io/docs/triggers/schedule)
- [Cloudflare DNS integrations](https://www.fasthook.io/apps/cloudflare-dns/integrations)
- [Cloudflare R2 integrations](https://www.fasthook.io/apps/cloudflare-r2/integrations)

## Related workflow templates

- [Notify ntfy when a domain has no mail DNS records](https://www.fasthook.io/templates/cloudflare-dns-empty-mail-check-to-ntfy.md): Watch a domain that should have mail configured.
- [Alert Discord when DNSSEC is not active](https://www.fasthook.io/templates/cloudflare-dnssec-status-to-discord.md): Check the signing status Cloudflare reports for one zone.
- [Keep dated mail DNS snapshots in Google Drive](https://www.fasthook.io/templates/cloudflare-dns-mail-snapshots-to-google-drive.md): Give your mail administrator a dated text file listing the domain’s MX, SPF and DMARC records, including days when the configuration stays the same.
- [Back up a DNS zone to Dropbox](https://www.fasthook.io/templates/cloudflare-dns-zone-backups-to-dropbox.md): Save a BIND zone file to a private Dropbox folder each day.
- [Back up a group of KV keys to R2](https://www.fasthook.io/templates/cloudflare-kv-prefix-backups-to-r2.md): Export a selected prefix with binary values, metadata and absolute expiry times.
- [Archive a daily D1 SQL export in R2](https://www.fasthook.io/templates/cloudflare-d1-backups-to-r2.md): Export database schema and data as SQL and save a dated copy in the selected R2 bucket.
