Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- TOKEN="API-TOKEN"
- ZONE_ID="ZONE-ID"
- curl -s -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
- -H "Authorization: Bearer ${TOKEN}" \
- -H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (
- while read id; do
- curl -s -X DELETE https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${id} \
- -H "Authorization: Bearer ${TOKEN}" \
- -H "Content-Type: application/json"
- done
- )
- #source: https://gist.github.com/slayer/442fa2fffed57f8409e0b23bd0673a92
Add Comment
Please, Sign In to add comment