Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

d4c00/cf-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The development has moved to Codeberg / 开发已迁移至 Codeberg:
https://codeberg.org/length/cf-ddns

Download the code

mkdir -p ~/scripts/cf-ddns
curl -L https://code.length.cc/cf-ddns.tar.gz | tar -xz -C ~/scripts/cf-ddns --strip-components=1

Create Config

nano ~/scripts/cf-ddns/example.com.ini

Paste Template

[auth]
dns_cloudflare_api_token = YOUR_TOKEN

[ipv4]
#'api' or 'local'
source = api
api_list = 
    https://icanhazip.com
    https://ident.me
    https://ifconfig.me/ip
    https://checkip.amazonaws.com
domains = 
    a.example.com
	b.example.com

[ipv6]
source = local
api_list = 

domains = 
    a.example.com
	b.example.com

Supports one .ini or multiple files (e.g., a.ini, b.ini).
The script processes all found .ini files.

Set permissions

chmod 600 ~/scripts/cf-ddns/*.ini

Grant execution permission to the script

chmod +x ~/scripts/cf-ddns/cf-ddns.py

Create the systemd user service directory

mkdir -p ~/.config/systemd/user/

Create symbolic links (to register services with Systemd)

ln -sf ~/scripts/cf-ddns/cf-ddns.service ~/.config/systemd/user/cf-ddns.service
ln -sf ~/scripts/cf-ddns/cf-ddns.timer ~/.config/systemd/user/cf-ddns.timer

Reload the daemon and enable the timer immediately

systemctl --user daemon-reload
systemctl --user enable --now cf-ddns.timer

Enable Linger (ensures the timer runs even after you log out of SSH)

sudo loginctl enable-linger $(whoami)

If DNS updates fail, try clearing the cache files

rm /tmp/cf_zone_ids.json /tmp/cf_last_ip.cache

Last Updated: 2026-04-30
Copyright (c) 2026 length me@length.cc (https://github.com/d4c00)
Licensed under the MIT License.

About

Cloudflare DDNS scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages