This is a script to automatically update dns ipv4 record on CloudFlare every 3 second
Login in to CloudFlare account then go to MyProfile -> API Tokens create Edit zone DNS token
Login in to CloudFlare account select website/domain to use
In the API session at right side Zone ID is there
copy curl command below
curl --request GET \
--url https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {API_token}'
replace {zone_id} and {API_token} to your zoneID and APItoken
run it on terminal then find the record name to use and copy the record id
edit cloudflare-ddns-update.sh fill in the APItoken, zoneID and recordID
copy cloudflare-ddns-update.sh into /etc/
copy cloudflare-ddns.service into /etc/systemd/system/
install required tools
Debian based
sudo apt-get install python curl -y
RHEL based
sudo yum install python curl -y
set owner to root
sudo chown root:root /etc/cloudflare-ddns-update.sh
sudo chown root:root /etc/systemd/system/cloudflare-ddns.service
set permission
sudo chmod +x /etc/cloudflare-ddns-update.sh
sudo chmod +x /etc/systemd/system/cloudflare-ddns.service
reload daemon
sudo systemctl daemon-reload
set the service to auto start on startup
sudo systemctl enable cloudflare-ddns
start service now
sudo systemctl start cloudflare-ddns
edit cloudflare-ddns-update.sh fill in the APItoken, zoneID and recordID
set permission
sudo chmod +x install.sh
run install script
sudo ./install.sh
edit cloudflare-ddns-update.sh fill in the APItoken, zoneID and recordID
set permission
chmod +x install.sh
run install script
./install.sh
donate to me
Donate Link
THANK for your support