tachi107 / cloudflare-ddns Goto Github PK
View Code? Open in Web Editor NEWSimple utility to dynamically change a DNS record using Cloudflare
License: GNU Affero General Public License v3.0
Simple utility to dynamically change a DNS record using Cloudflare
License: GNU Affero General Public License v3.0
See #14 (comment)
Suggestion: Add the possibility to update more than one DNS entry via one call to cloudflare-ddns
. The idea here is if you e.g. have a Dual Stack connection (i.e. an IP v4 and an IP v6 address), you will need to call it twice anyway. Ofc you could just do this with another config file and another systemd timer, but this seems a bit bulky. Also, if you want to have an A and AAAA entry for the same domain, this is afaik currently only possible with the library.
I see two feasible options for this:
I think the second option is better, because we easier fetch the records in parallel while caching the IP addresses. For more parallelization / speed ups, the config could be extended even more to prevent a get_record
call at all:
[GENERAL]
cache_ipv4 = true
cache_ipv6 = true
[example.org_ipv4]
api_token = token
zone_id = id
record_name = example.org
ip_version = 4
[example.org_ipv6]
api_token = token
zone_id = id
record_name = example.org
ip_vesion = 6
[example.com]
api_token = token
zone_id = id
record_name = example.com
ip_version = 4
Currently inih is bundled as a submodule. However it is better to use Meson's built-in wrap feature: https://mesonbuild.com/Wrapdb-projects.html
I can open a PR tomorrow.
Can it be used on Windows or can Windows binary be generated?
Hello,
Great tool! I installed it and it works great, however...
I wanted to see what the service outputs and noticed this warning
Mar 11 11:09:25 proxy (are-ddns)[995]: ConfigurationDirectory 'cloudflare-ddns' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 700)
full log below:
root@proxy:~# systemctl status cloudflare-ddns.service
* cloudflare-ddns.service - Simple utility to dynamically change a DNS record
Loaded: loaded (/lib/systemd/system/cloudflare-ddns.service; static)
Active: inactive (dead) since Mon 2024-03-11 11:09:26 EET; 1min 9s ago
TriggeredBy: * cloudflare-ddns.timer
Docs: man:cloudflare-ddns(1)
Process: 995 ExecStart=/usr/bin/cloudflare-ddns (code=exited, status=0/SUCCESS)
Main PID: 995 (code=exited, status=0/SUCCESS)
CPU: 130ms
Mar 11 11:09:25 proxy systemd[1]: Starting cloudflare-ddns.service - Simple utility to dynamically change a DNS record...
Mar 11 11:09:25 proxy (are-ddns)[995]: ConfigurationDirectory 'cloudflare-ddns' already exists but the mode is different. (File system: 755 ConfigurationDirectoryMode: 700)
Mar 11 11:09:26 proxy cloudflare-ddns[995]: The A record is up to date
Mar 11 11:09:26 proxy cloudflare-ddns[995]: The AAAA record is up to date
Mar 11 11:09:26 proxy systemd[1]: cloudflare-ddns.service: Deactivated successfully.
Mar 11 11:09:26 proxy systemd[1]: Finished cloudflare-ddns.service - Simple utility to dynamically change a DNS record.
so then I went ahead and did chmod 700 /etc/cloudflare-ddns/
and then restarted systemctl restart cloudflare-ddns.service
and it failed with
Job for cloudflare-ddns.service failed because the control process exited with error code.
See "systemctl status cloudflare-ddns.service" and "journalctl -xeu cloudflare-ddns.service" for details.
root@proxy:/etc# systemctl status cloudflare-ddns.service
x cloudflare-ddns.service - Simple utility to dynamically change a DNS record
Loaded: loaded (/lib/systemd/system/cloudflare-ddns.service; static)
Active: failed (Result: exit-code) since Mon 2024-03-11 11:16:29 EET; 16s ago
TriggeredBy: * cloudflare-ddns.timer
Docs: man:cloudflare-ddns(1)
Process: 1059 ExecStart=/usr/bin/cloudflare-ddns (code=exited, status=1/FAILURE)
Main PID: 1059 (code=exited, status=1/FAILURE)
CPU: 22ms
Mar 11 11:16:29 proxy systemd[1]: Starting cloudflare-ddns.service - Simple utility to dynamically change a DNS record...
Mar 11 11:16:29 proxy cloudflare-ddns[1059]: Unable to open /etc/cloudflare-ddns/config.ini
Mar 11 11:16:29 proxy systemd[1]: cloudflare-ddns.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 11:16:29 proxy systemd[1]: cloudflare-ddns.service: Failed with result 'exit-code'.
Mar 11 11:16:29 proxy systemd[1]: Failed to start cloudflare-ddns.service - Simple utility to dynamically change a DNS record.
๐คท๐ป
I have both a www.example.com as well as example.com records that need updating. Is there a way to update both using the .ini file? I couldn't figure out a way.
I have a setup similar to this one:
A test.example.com <some_ip_v4>
AAAA test2.example.com <some_ip_v6>
Using cloudflare-ddns with test.example.com
works just fine, but changing it to test2.example.com
results in a SIGABRT:
terminate called after throwing an instance of 'simdjson::simdjson_error'
what(): The JSON element does not have the requested type.
Aborted
Having IP v6 support for DDNS gets more and more important as providers using DS-Lite.
The Zone ID is currently stored in /var/cache
as a plain ID, and the executable has no way of knowing what Zone it belongs to. This could create issues when running multiple instances of the tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.