Cloudflare Update DNS Record using API Script
You can use for automation edit DNS Record using script.
Clone this repository, you can move this script file to /usr/local/bin or directly run.
Give execute permission
cd cloudflare-api-dns
chmod +x *
Change the credentials (API_KEY, EMAIL, ZONE_ID)
Reference to get the credentials:
- https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
- https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/
For using this all script, make sure you have installed jsontools / jq in Linux
Usage: ./get.sh
cod.example.com A xx.xx.xx.xx
jenkins.example.com A xx.xx.xx.xx
jitsi.example.com A xx.xx.xx.xx
example.com A xx.xx.xx.xx
Usage: ./add.sh <subdomain> <record type> <record content> <proxied> <TTL>
./add.sh test CNAME test.aryapramudika.com false 3600
Usage: ./delete.sh <record name> <record type>
./delete.sh test CNAME