Skip to content

Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH~

License

Notifications You must be signed in to change notification settings

olgv/cloudflare-ddns-updater

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare (conditional) Dynamic DNS IP Updater

GitHub GitHub last commit (branch)

This script is used to update Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH.

This fork is an amendment to cloudflare-ddns-updater adding a function that checks if the IP has changed, as there is no need to update the DNS record since it already points to the correct IP address. This check helps reduce unnecessary API calls to Cloudflare and saves resources.

On the other hand, if the IP is changing, the script will log this IP into the current-ip.txt file and go ahead with updating the DNS record using the new IP.

Installation

git clone https://github.com/olgv/cloudflare-ddns-updater.git

Usage

Update your details requested in lines 4-14 (4-8 are compulsory).

Note: I had to use an API Token not a Global API Key in CloudFlare, and keep the script to token on line 5.


This script is used with crontab

crontab -e

Specify the frequency of execution through crontab

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday 7 is also Sunday on some systems)
# │ │ │ │ │ ┌───────────── command to issue                               
# │ │ │ │ │ │
# │ │ │ │ │ │
# * * * * * /bin/bash {Location of the script}

Make sure you make both the script cloudflare-template.sh (or how ever you decide to call it) and the current-ip.txt file editable by using:

chmod +x cloudflare-template.sh
chmod +x current-ip.txt

and keep the two files together, in the same place.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Reference

This script is an amendment to the original cloudflare-ddns-updater. Support by K0p1-Git via PayPal here.
This script was also made with reference from Keld Norman video.

License

MIT

About

Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH~

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%