Skip to content

Instantly share code, notes, and snippets.

@SuTree
SuTree / cloudflare-delete-all-records.sh
Last active November 21, 2021 18:50 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
[email protected]
KEY=11111111111111111111111111
ZONE_ID=2222222222222222222222222
curl -sLX GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "X-Auth-Email: ${EMAIL}" \
-H "X-Auth-Key: ${KEY}" \
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (