This repository provides a PHP script for bulk deleting DNS records in Cloudflare using the Cloudflare API.
Before you begin, ensure you have met the following requirements:
- PHP installed on your local machine or server.
- Composer installed for managing dependencies.
- A Cloudflare account with an active Zone ID.
- Cloudflare API Token with the necessary permissions.
-
Clone this repository to your local machine:
git clone https://github.com/fahamjv/cloudflare-bulk-dns-delete.git
-
Change to the project directory:
cd cloudflare-bulk-dns-delete
-
Install the required dependencies using Composer:
composer install
-
Get your tokens
Cloudflare Zone ID https://dash.cloudflare.com/.
-
Copy the .env file
cp .env.example .env
-
Open the .env file and fill it with your tokens:
ZONE_ID= API_TOKEN=
-
Run the script:
php main.php
The script will start deleting DNS records in batches. It will handle rate limiting and retries for failed deletions.