- A script for Cloudflare DDNS on Synology DSM.
- A Minimum Settings required.
- Uses Cloudflare API v4.
2022.02.14. Supports both "API Tokens" and "Global API Key"
- Have a active Zone in Cloudflare. (Your own domain, too)
- Have a A Record.
-
Open Task Scheduler (Control Panel - [Services] Task Scheduler)
-
Create a user-defined script item. Create - Triggered Task - User-defined script
[General Tab]
Task: Cloudflare DDNS (not important)
User: root
Event: Boot-up
Pre-task: none
Enabled: Checked
[Task Settings Tab]
[Run Command] User-defined script
curl https://raw.githubusercontent.com/michaelochs/SynologyCloudflareDDNS/master/setddns.py | python3 -
-
Press OK
-
Right-Click on the task you've just created.
-
Click Run
-
You can see Cloudflare DDNS has been added to your DDNS list.
-
Setup DDNS in Synology DSM (You can use "API Tokens" or "Global API Key")
a. Using API Tokens (Recommended)
(1) Single Domain and single permission can granted with a Token -> more secure
(2) How to create: Cloudflare - My Profile - API Tokens - Create Token (Use "Edit zone DNS" template, required permission: Zone - DNS - Edit)
(3) Synology DDNS SettingsUsername: Anything you want(not using when authorize the token) Password: API Token (40 byte)
b. Using Global API Key
(1) All permission with a single API Key - less secure
(2) How to view: Cloudflare - My Profile - API Tokens - Global API Key - Click "View"
(3) Synology DDNS SettingsUsername: Cloudflare Username Password: Global API Key (37 byte)
- Connect via SSH. (can be activated in DSM)
- Execute
sudo curl https://raw.githubusercontent.com/michaelochs/SynologyCloudflareDDNS/master/cloudflare.php -o /usr/syno/bin/ddns/cloudflare.php && sudo chmod 755 /usr/syno/bin/ddns/cloudflare.php
- Add some notes to end of DDNS config file. You can use your preferred text-editor. (sudo vi /etc.defaults/ddns_provider.conf)
[Cloudflare]
modulepath=/usr/syno/bin/ddns/cloudflare.php
queryurl=https://www.cloudflare.com/
- Set up DDNS in DSM (Use your Cloudflare Global API Key(can be found in My Profile) as a password)