A bash script used to access the Cloudflare API remotely to backup the DNS Zone Configuration.
A Remote system for running the script and saving the output.
(Iam using Debian for example, curl needs to be installed)
You need to create an API Token and get the Zone ID of the DNS Zone you want to Backup.
Create Cloudflare API Key
Get Cloudflare DNS Zone ID
Install the dependencies for debian to run the script
$ sudo apt install curl
Make the script executable
$ sudo chmod u+x /*pathtobackupscript*/cloudflare-api-dns-backup.sh
Execute the script through crontab, in the example at 1 in the morning
$ sudo crontab -e
0 1 * * * /*pathtobackupscript*/cloudflare-api-dns-backup.sh
https://github.com/curl/curl
https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-export-dns-records
This repository is licensed under the GNU General Public License v3.0.
For more information, see the LICENSE file.
This repository is for educational and informational purposes only.
The author assumes no liability for any damages that may arise from the use of the contents of this repository.
Contributions are always welcome! If you find an error or would like to suggest an improvement, please create an issue.