Cloudflare Scripts
Download
Download Cloudflare Scripts — zip containing the script and README.
Shell scripts for fetching zone configuration, DNS records, and routing rules from the Cloudflare API across all Pacing-managed domains.
Scripts
| Script | Description |
|---|---|
cloudflare-fetch-zones.sh | Fetches zone details, DNS records, Page Rules, Transform Rules, Single Redirects, Workers Routes, SSL/TLS settings, and security level for all three domains |
Usage
CLOUDFLARE_API_TOKEN=your_token ./cloudflare-fetch-zones.sh
Or export the token first:
export CLOUDFLARE_API_TOKEN=your_token
./cloudflare-fetch-zones.sh
Output is printed to stdout. Pipe to a file to save:
./cloudflare-fetch-zones.sh > output.txt
Output
The script prints a structured report for each domain in sequence. For each zone it includes:
- Zone ID and plan — zone identifier, status, plan name, name servers
- DNS records — all A, CNAME, MX, TXT records with proxy status and TTL
- Page Rules — active page rules (if any)
- Transform Rules (Redirects) — redirect rules via the Rulesets API
- Single Redirects — bulk redirect rules
- Workers Routes — Worker script assignments per route pattern
- SSL/TLS settings — SSL mode per zone
- Security Level — current security level setting
Domains covered (hardcoded): pacing.agency, pacingagency.com, pacingagency.co.uk.
Requirements
Environment variables:
| Variable | Required | Description |
|---|---|---|
CLOUDFLARE_API_TOKEN | Yes | API token with Zone:Read permissions for all target zones |
CLI tools:
curl— for API requestsjq— for JSON parsing and formatting
Getting an API token:
- Go to Cloudflare → Profile → API Tokens
- Create a token with Zone:Read permissions
- Scope to the specific zones or all zones as needed
Never commit the token to git. Store it in the root .env file:
CLOUDFLARE_API_TOKEN=