The idea is to keep consistency of adding DDNS in the Synology Control Panel External Access, so user can manage all DDNS records in one place.
Advantages:
- Synology DSM update all DDNS items every day
- Synology DSM has internal checking for WAN IP change, and trigger the DDNS update in minutes
- Scripts will check the DNS record first, do not update if current IP is the same
- IPv6 is supported
- Scripts log event results to an easy accessible file
Table of Content
The is a script to be used to add Cloudflare as a DDNS to Synology NAS. The script used an updated API, Cloudflare API v4.
- Login to your DSM
- Go to Control Panel > Terminal & SNMP > Enable SSH service
- Use your client to access Synology via SSH.
- Use your Synology admin account to connect.
- Download
dsmCloudflareDdnsModule.sh
from this repository to/sbin/cloudflareddns.sh
or any folder as you like
wget https://raw.githubusercontent.com/myrenyang/SynologyDsmDdns/main/dsmCloudflareDdnsModule.sh -O /sbin/cloudflareddns.sh
-
(Optional) Update the script to change the log file location, by default it is
/var/services/web/logs/ddnsLog.txt
, that means you can see the log on website if you have enabled Web Station. -
Make it executable in
/sbin/cloudflareddns.sh
chmod +x /sbin/cloudflareddns.sh
If you put the it in another folder, just make a link
ln -s /whatever-path-of-the-folder/cloudflareddns.sh /sbin/cloudflareddns.sh
- Add
cloudflareddns.sh
to Synology Config Panel
Append following config to /etc.defaults/ddns_provider.conf
.
[Cloudflare]
modulepath=/sbin/cloudflareddns.sh
queryurl=https://www.cloudflare.com
website=https://dash.cloudflare.com
You can use VI editor or following commands
echo "[Cloudflare]" >> /etc.defaults/ddns_provider.conf
echo " modulepath=/sbin/cloudflareddns.sh" >> /etc.defaults/ddns_provider.conf
echo " queryurl=https://www.cloudflare.com" >> /etc.defaults/ddns_provider.conf
echo " website=https://dash.cloudflare.com" >> /etc.defaults/ddns_provider.conf
echo "" >> /etc.defaults/ddns_provider.conf
Note, queryurl
does not matter because we are going to use our script but it is needed.
- Go to your domain overview page and copy your zone ID.
- Go to your profile > API Tokens > Create Token. It should have the permissions of
Zone > DNS > Edit
. Copy the api token.
- Login to your DSM
- Go to Control Panel > External Access > DDNS > Add
- Enter the following:
- Service provider:
Cloudflare
- Hostname: Full domain name that need to update ip, like
www.example.com
- Username: Put domain Zone ID here, like
o4ngn949nsod0ngo09e9df90hs0hs8kj
- Password: Put API Token here, like
pGWuZ245NDluc29kMG5nbzA5ZTlkZjkwaHMwaHM4
- Service provider:
The is a script to be used to add Godaddy as a DDNS to Synology NAS. The script used an API v1.
- Login to your DSM
- Go to Control Panel > Terminal & SNMP > Enable SSH service
- Use your client to access Synology via SSH.
- Use your Synology admin account to connect.
- Download
dsmGodaddyDdnsModule.sh
from this repository to/sbin/godaddyddns.sh
or any folder as you like
wget https://raw.githubusercontent.com/myrenyang/SynologyDsmDdns/main/dsmGodaddyDdnsModule.sh -O /sbin/godaddyddns.sh
-
(Optional) Update the script to change the log file location, by default it is
/var/services/web/logs/ddnsLog.txt
, that means you can see the log on website if you have enabled Web Station. -
Make it executable in
/sbin/godaddyddns.sh
chmod +x /sbin/godaddyddns.sh
If you put the script file in another folder, just make a link
ln -s /whatever-path-of-the-folder/godaddyddns.sh /sbin/godaddyddns.sh
- Add
godaddyddns.sh
to Synology
Append following config to /etc.defaults/ddns_provider.conf
.
[GoDaddy]
modulepath=/sbin/godaddyddns.sh
queryurl=https://developer.godaddy.com
website=https://dcc.godaddy.com
You can use VI editor or following commands
echo "[GoDaddy]" >> /etc.defaults/ddns_provider.conf
echo " modulepath=/sbin/godaddyddns.sh" >> /etc.defaults/ddns_provider.conf
echo " queryurl=https://developer.godaddy.com" >> /etc.defaults/ddns_provider.conf
echo " website=https://dcc.godaddy.com" >> /etc.defaults/ddns_provider.conf
echo "" >> /etc.defaults/ddns_provider.conf
Note, queryurl
does not matter because we are going to use our script but it is needed.
- Log into your GoDaddy account. Go to https://developer.godaddy.com/keys and click Create New API Key.
- When a new window opens, Choose a Name for your new API key then select Production as Environment. Click Next.
- Copy your Key and your Secret Key to a text file and be careful not to lose it. Click Got it!
- Login to your DSM
- Go to Control Panel > External Access > DDNS > Add
- Enter the following:
- Service provider:
GoDaddy
- Hostname:
www.example.com
or@.example.com
for the root domain - Username:
<api token>
- Password:
<secret>
- Service provider: