This script automatically updates Cloudflare DNS records when the IP address of your Synology NAS changes. This allows you to always access your NAS via a domain name, even if your ISP changes your IP address.
- Supports both IPv4 (A records) and IPv6 (AAAA records).
- Utilizes the Cloudflare API to keep your DNS records up-to-date.
- Integrates with Synology DSM DDNS package to obtain the current external IP address of your NAS.
Before using this script, make sure that:
- You have a Cloudflare account and have access to your API key.
curlandjqare installed on your Synology NAS.- Your domain name is managed by Cloudflare, and you have the permissions to modify its DNS records.
- Synology DDNS client is installed on your Synology NAS (more info on this in the Installation section).
Use the following command to run the script:
/sbin/cloudflare_ddns.sh <username> <token> <hostname> <ip>Where:
<username>is your Cloudflare account ID.<token>is your Cloudflare API key.<hostname>is the hostname you want to update, for example,example.com.<ip>is the IP address to set. This is optional and if not specified, the script will automatically detect the external IP address of your NAS.
The script uses the following exit codes:
1- Prerequisites are missing or parameters are invalid.2- The hostname format is invalid.3- Authentication failed.4- Prerequisites are missing.
In order to install this script, please follow the instructions in the INSTALLATION.md file.
Contributions are welcome. Please feel free to submit a pull request or open an issue on GitLab.
This script is provided as is with no warranty. Please use it at your own risk and ensure you understand what the script does before running it.
The following projects were used as inspiration for this script:
This project is licensed under the MIT License. See the LICENSE file for details.