Set up Dynamic DNS with Cloudflare on Synology DSM 6


In the Synology DSM there are several DDNS services available. Unfortunately Cloudflare isn’t among them. But there is a way to get it up and running thanks to joshuaavalon at github.

First of all you need a domain name already using cloudflare. If you don’t, there might not be any reason for you to read this tutorial.


  1. Download and install script to NAS
  2. Get needed info from Cloudflare
  3. Update the script
  4. Activate DDNS in DSM

1. Download and install script to NAS

a. log in to your nas with SSH as admin. If SSH isn’t activated, do the following

  • Login to your DSM
  • Go to Control Panel > Terminal & SNMP > Enable SSH service
  • Open a terminal of choice and type ssh admin@NASHOSTNAME or IP

b. Download from joshuavalons githup repository to /sbin/ by entering the following command

sudo wget -O /sbin/

c. Change permissions of file

sudo chmod +x /sbin/

d. Add to synology by pasting the following lines into your terminal and press enter.

sudo echo "[Cloudflare]">>/etc.defaults/ddns_provider.conf
sudo echo " modulepath=/sbin/">>/etc.defaults/ddns_provider.conf
sudo echo " queryurl=">>/etc.defaults/ddns_provider.conf

2. Get needed info from Cloudflare

a. Log in to your cloudflare account and select the domain you intend to use and go to “overview”.
b. Copy your “Zone ID:”
c. Copy your API key by selecting “Get your API key”


d. Edit the script below by replacing keys with the keys your retrieved earlier.
e. Get your record ID by pasting the updated script in your terminal and press enter.

curl -X GET "" \
   -H "X-Auth-Email:" \
   -H "X-Auth-Key: xxxxxxxxxxxxxAPI-KEYxxxxxxxxxxxxxxxx" \
   -H "Content-Type: application/json"

The record ID is the first ID listed in the output {“result”:[{“id”:”xxxxxxxxxxxRECORD-IDxxxxxxxxxxxxxxx“..


3. Update the script

a. You now need to update /sbin/ with the paramaters you have retrieved. I do this with Nano because vim doesn’t make sense =)
If you don’t have nano installed you can do it by installing entware or optware. I recommendthe following guide
in the script scroll down and edit the followin paramaters.

# CloudFlare Config

4 Activate DDNS in DSM

a. Log in to DSM, open the control panel and go to External Access and click Add under DDNS

b. Choose Cloudflare as service and enter your details in the DDNS window. Your password is your API-KEY and not your cloudflare password.


You should be all set! If not, don’t hesitate to comment and I’ll see if I can help.

Oh and as usual, if something breaks, blame the bad guys..



  1. I am sure I am not the only one, you’ve mentionned to comment if not… can I say that I wanted to thanks you a lot and add that it worked PERFECTLY ?
    This tutorial is just top because only few of the other mentionned so clearly how to make it match with DDNS on synology !
    Thanks a lot, a lot, a lot :)

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.