https://github.com/lfaoro/flares
Flares 🔥 is a CloudFlare DNS backup tool
https://github.com/lfaoro/flares
backup cloudflare dns export
Last synced: 24 days ago
JSON representation
Flares 🔥 is a CloudFlare DNS backup tool
- Host: GitHub
- URL: https://github.com/lfaoro/flares
- Owner: lfaoro
- License: mit
- Created: 2018-10-16T15:35:00.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2026-05-12T00:19:29.000Z (24 days ago)
- Last Synced: 2026-05-12T00:23:18.229Z (24 days ago)
- Topics: backup, cloudflare, dns, export
- Language: Go
- Homepage:
- Size: 2.56 MB
- Stars: 193
- Watchers: 6
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-cloudflare - Flares - DNS backup tool. (DNS)
- awesome-cloudflare - Flares - DNS backup tool. (DNS)
README
# Flares 🔥
Cloudflare DNS backup tool — exports DNS records as BIND-formatted zone files to stdout or disk.
## Quick Start
```bash
export CLOUDFLARE_API_TOKEN="KClp4y8BgD2LQiz2..."
# Show DNS records for a domain
flares show example.com
# Export as BIND zone file
flares export example.com
# All zones at once
flares show --all
flares export --all
# List zones
flares zones
```
Get your token at https://dash.cloudflare.com/profile/api-tokens (Create Token → Zone.DNS → Read → All zones).
## Install
### One-liner
```bash
curl -sfL https://raw.githubusercontent.com/lfaoro/flares/main/install.sh | sh
```
Install a specific version to a custom path:
```bash
curl -sfL https://raw.githubusercontent.com/lfaoro/flares/main/install.sh | sh -s -- -b /usr/local/bin v4.0.1
```
### Package Managers
| Platform | Command |
|----------|---------|
| macOS / Linux | `brew install lfaoro/tap/flares` |
| Arch Linux | `yay -S flares-bin` (AUR) |
| Nix | `nix profile install github:lfaoro/tap#flares` |
| Go | `go install github.com/lfaoro/flares/cmd/flares@latest` |
### Pre-built Binaries
Download the latest archive for your platform from the [releases page](https://github.com/lfaoro/flares/releases), then:
```bash
tar xzf flares_*.tar.gz
sudo mv flares /usr/local/bin/
```
### Docker
```bash
docker pull ghcr.io/lfaoro/flares
docker run --rm -e CLOUDFLARE_API_TOKEN="$CLOUDFLARE_API_TOKEN" \
ghcr.io/lfaoro/flares show example.com
```
## Usage
```
flares [--token TOKEN] [--debug] [flags] [...]
Commands:
show Print DNS records
--all, -a All zones
--output, -o FORMAT Output format: text (default) or json
export Write BIND zone files
--all, -a All zones
zones List all zone IDs and names
Global flags:
--token, -t Cloudflare API token [$CLOUDFLARE_API_TOKEN, $CF_API_TOKEN]
--debug, -d Enable debug output [$FLARES_DEBUG]
--threads, -c Max concurrent API requests for --all (default: 10) [$FLARES_THREADS]
```
### JSON Output
```bash
flares show --output json example.com
```
Returns `{"example.com": "; Domain: example.com\n...BIND records..."}` — useful for scripting.
### Using --all
```bash
# Dump all zones to stdout
flares show --all
# Export every zone to its own file in the current directory
flares export --all
```
Concurrent exports are throttled to 10 simultaneous requests to avoid Cloudflare rate limits.
## Token
Create a token at https://dash.cloudflare.com/profile/api-tokens with:
- **Permissions**: Zone → DNS → Read
- **Zone Resources**: Include → All zones
Verify your token:
```bash
curl -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
https://api.cloudflare.com/client/v4/user/tokens/verify
```
## Development
```bash
nix-shell # Go 1.26, golangci-lint, goreleaser, gofumpt
make build # Build binary
make test # Run all tests
make lint # golangci-lint (30+ linters)
make reltest # Dry-run goreleaser snapshot
```