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

joeltgray/cloudflare-ddns-updater

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 

Repository files navigation

Cloudflare Dynamic DNS IP Updater

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 version of this script allows you to update multiple domains/sub domains with the same public IP for IPv4, IPv6 version remains per single domain.

Clone

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

Usage

This version of the script is used with systemd. Update the paths in config below to match your setup. If you need to know how to use systemd services check out my blog here: Running A Service on Systemd

Make the Script Executable

chmod u+x /path/to/your/cloudflare-ddns-updater/cloudflare-dns-updater.sh

Make the service file

nano /etc/systemd/system/cloudflare-ddns-updater.service

[Unit]
Description=Service to update Cloudflare servers with this servers public IP

[Service]
ExecStart=/bin/bash  /path/to/your/cloudflare-ddns-updater/cloudflare-dns-updater.sh
Restart=
EnvironmentFile=/etc/environment

[Install]
WantedBy=multi-user.target

Make the service timer file

nano /etc/systemd/system/cloudflare-ddns-updater.timer

[Unit]
Description=Run the script for Cloudflare SDNS updates every 5 minutes

[Timer]
OnCalendar=*-*-* *:00/5:05
OnBootSec=5
Persistent=true

[Install]
WantedBy=timers.target

Enable and start the service

systemctl daemon-reload systemctl enable cloudflare-ddns-updater.service systemctl enable cloudflare-ddns-updater.timer systemctl start cloudflare-ddns-updater.timer

Tested Environments:

Original:
macOS Mojave version 10.14.6 (x86_64)
AlmaLinux 9.3 (Linux kernel: 5.14.0 | x86_64)
Debian Bullseye 11 (Linux kernel: 6.1.28 | aarch64)

This version:
Debian 11 (Linux kernel: 6.1.0-0.deb11.13-amd64 | x86_64)
Arch rolling (Linux kernel: 6.7.4-arch1-1 | x86_64)
Raspbian 11 (Linux kernel: 6.1.21-v8+ | aarch64)

Contributing

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

Reference

This script was originally made by Keld Norman video, I've adapted from Jason K's version

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%