Before starting the installation process, make sure you have (and know) the following information, or have completed these steps:
a. Know your Cloudflare account username (or register for an account if you're new to Cloudflare); and
Ensure the DNS A record(s) for the domain/zone(s) you wish to update with this script have been created (More information: Managing DNS records).
Your DNS records should appear (or already be setup as follows) in Cloudflare:
(Note: Having Proxied turned on for your A records isn't necessary, but it will prevent those snooping around from easily finding out your current IP address)
Activate SSH on your supported device:
a. For DSM Users:
Navigate to Control Panel > Terminal & SNMP > Enable SSH service
b. For SRM users:
Navigate to Control Panel > Services > System Services > Terminal > Enable SSH service
Connect via SSH: Connect to your supported device via SSH and execute command
For DSM Users
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/cloudflare.php -O /usr/syno/bin/ddns/cloudflare.php && sudo chmod 755 /usr/syno/bin/ddns/cloudflare.php
For SRM Users Note: Ensure you are connected as root in your SSH session
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/cloudflare.php -O /usr/syno/bin/ddns/cloudflare.php && chmod 755 /usr/syno/bin/ddns/cloudflare.php
Note: For SRM users, you must connect to your device as root. No other username will allow these commands to run.
Update DDNS provider list: Using your preferred/available command line editor, insert the text below to your DMS file (Location : /etc.defaults/ddns_provider.conf), to add DDNS support via Cloudflare:
[Cloudflare] modulepath=/usr/syno/bin/ddns/cloudflare.php queryurl=https://www.cloudflare.com/
Note: For SRM users, break out this Vim cheat sheet, as it's the only text editor available to you.
Update your DDNS settings:
a. For DSM Users: Navigate to Control Panel > External Access > DDNS then add new DDNS
b. For SRM users: Navigate to Network Centre > Internet > QuickConnect & DDNS > DDNS and press the Add button:
Add/Update the DDNS settings screen as follows:
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
Enjoy 🍺 and don't forget to deactivate SSH (step 1) if you don't need it.
This will manifest as either 1020 error; or the update attempt not showing in your Cloudflare Audit logs.
That generally means you may not have entered something correctly in the DDNS screen for your domain(s).
Handy hint: You can also check your Cloudflare Audit logs to see what - if anything - has made it there with your API key (More information: Understanding Cloudflare Audit Logs). Updates using the API will appear in the Audit logs as a Rec Set action.
After system updates to either Synology DSM or SRM, you may find that:
If this occurs, simply repeat the How to install steps shown above.
|HTTP ports supported by Cloudflare||HTTPS ports supported by Cloudflare|