A simple script to update your DNS records on CloudFlare. This script leverages CloudFlare's API to dynamically update DNS records.
- Check if another instance of the script is running
- Self-installation and configuration initialization
- Periodic updates using crontab
- Logging of updates
- Simple uninstallation
- Clone the repository:
git clone https://github.com/andrearaponi/ddns-cloudy
- Navigate to the repository:
cd ddns-cloudy
- Ensure the script is executable:
chmod +x ddns-cloudy.sh
- Run the script with sudo privileges to initialize configuration:
sudo ./ddns-cloudy.sh
- Follow the on-screen instructions to set up your CloudFlare configuration.
Once installed, the script will automatically run at the specified interval using crontab.
However, you can manually trigger an update by running:
/usr/local/bin/ddns-cloudy.sh run
Run the script with sudo privileges and choose the "Uninstall" option:
sudo ./ddns-cloudy.sh
curl
: Used for API requestsdig
: Used to fetch public IP address
Configuration is stored in ~/.cloudflare_update_config
. This file contains sensitive information (API Key) and should be kept secure.
Logs can be found in /var/log/cloudflare_update.log
. They provide a history of DNS updates.
Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this
You can check out the full license here
This project is licensed under the terms of the MIT license.
Note: It's essential to ensure that users are aware of any sensitive information the script handles, especially when dealing with API keys. Always advise users to be cautious and not to share the configuration file with anyone else.