← Back to Tools
Open Source Tool

Cloudflare DNS Backup

Bash DNS Recovery Cloudflare API

Automated Bash script that backs up every DNS record across all your Cloudflare zones via the API. Exports to timestamped JSON files — run it before DNS changes, on a daily cron, or after incidents to maintain a recoverable record of your DNS state.

View on GitHub ↗ Read the Write-up →
Run before and after every DNS change. If something breaks, you have an exact record of what existed — and can restore it manually or via re-import in minutes.

What it does

Quick start

# Clone the repo
git clone https://github.com/mylesagnew/cloudflare-backup
cd cloudflare-backup

# Set your Cloudflare API token
export CF_API_TOKEN=your_token_here

# Run backup — exports all zones to ./backups/
./backup.sh

# Optional: schedule daily via cron
crontab -e
# 0 2 * * * /path/to/cloudflare-backup/backup.sh

Related resources

Get notified when new tools and checklists drop.

Join Security Tool Updates →