A Dynamic DNS systemd service for Cloudflare written in Rust.
There is no distributable as of right now. I'll maybe get around to it at some point, but until then, refer to Building to create an executable.
Once you have an executable place it in a location (eg. /usr/local/bin/), take note of the executable's location, and follow the next steps:
- Modify
cloudflare-ddns.serviceto changeExecStart=to the location of thecloudflare-ddnsbinary (eg.ExecStart=/usr/local/bin/clouflare-ddns) - Move both
cloudflare-ddns.serviceandcloudflare-ddns.timerinto/etc/systemd/system/ - Run
systemctl daemon-reloadto register the new services - Run both
systemctl enable cloudflare-ddns.timerandsystemctl start cloudflare-ddns.timerto start the timer service - When it runs for the first time, a new config file should be generated at
/etc/cloudflare-ddns/config.toml, there is an example (config.example.toml) provided in this repo. You can also refer to Configuration for more info on what all the config options are.
- Clone this repo (
git clone https://github.com/GlitchlessCode/cloudflare-ddns.git) - Enter the directory (
cd cloudflare-ddns) - Build the binary (
cargo build --release) - The binary will be located at (
./target/release/cloudflare-ddns)
active - bool (default: false) - WHETHER TO RUN THE DDNS
[ip-find]
finders - Vec<String> (default: []) - LIST OF URLS TO TRY FETCHING THE PUBLIC IP FROM
retries - bool (optional) - NUMBER OF RETRY ATTEMPTS FOR EACH FINDER URL
timeout - bool (optional) - TIMEOUT IN SECONDS FOR EACH FINDER ATTEMPT
[cloudflare]
api-key - String (default: "") - YOUR API KEY FOR CLOUDFLARE. MUST HAVE EDIT DNS PERMISSIONS
zone-identifier - String (default: "") - THE ID OF THE ZONE TO EDIT
dns-record-name - String (default: "") - THE NAME OF THE RECORD TO EDIT
[cache]
ignore - bool (optional) - WHETHER TO IGNORE THE CACHE AND FORCE A CLOUDFLARE UPDATE EVEN IF ONE ISN'T NECESSARY
persist - bool (optional) - WHETHER TO WRITE TO THE CACHE AND SAVE THE LAST SENT IP
MIT License
Copyright (c) 2025 GlitchlessCode
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.