Skip to content

☁️ PHP script to allow Synology NAS auto update Cloudflare DNS record via API call

Notifications You must be signed in to change notification settings

vareversat/synology-cloudflare-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Synology DynDNS using Cloudflare API

Note

This script has been tested on a Synology DS218+ running DSM 7.1.1-42962 Update 6

This project is entended to add a DynDNS custom provider for Synology NAS

The genesis 🧠

Synology NAS does not support Cloudflare DNS automatic update (I mean directly via Cloudflare API, it is possible to use DNS-o-matic to automaticly update you DNS record). So I decided to create this little PHP script.

How to

Important

You need to have a SSH access with root privileges to your NAS to perform the following commands

  1. Add a new DynDNS providers
cat <<EOF >>/etc.defaults/ddns_provider.conf
[Cloudflare]
        modulepath=/usr/syno/bin/ddns/cloudflare.php
        queryurl=https://api.cloudflare.com/
EOF
  1. Create a new PHP script file
vi /usr/syno/bin/ddns/cloudflare.php

And add the content of cloudflare.php

  1. Set your Cloudflare zone ID
sed -i 's/__CLOUDFLARE_ZONE_ID__/YOUR_CLOUDFLARE_ZONE_ID/g' /usr/syno/bin/ddns/cloudflare.php
  1. Setup your Synology DDNS parameters

Go to Control Panel > Connectivity > External Access > DDNS and Add a new entry

  • Service Provider : Cloudflare
  • Hostname : A valid domain name (ex: mynas.synology.com)
  • Username/Email : The existing Cloudflare DNS record ID
  • Password/Key: The Cloudflare API Token with Zone DNS Edit permission

Click on Test Connection and your NAS is ready to automaticly update your public domain name !

About

☁️ PHP script to allow Synology NAS auto update Cloudflare DNS record via API call

Resources

Stars

Watchers

Forks