Cloudflare DDNS for QNAP and Synology NAS and other Linux systems. Based on Cloudflare Worker or other Serverless functions.
With this small but nice interface, it is possible to host your own api to use Cloudflare domains for your DynDNS on QNAP or Synology NAS systems
The API responds with JSON and matching status codes for QNAP and Synology systems
Required information:
- Cloudflare Account email
- Cloudflare Global API Key (not Origin CA Key)
- Cloudflare registered domain (like
example.com
) - DNS Record (like
my-ddns.example.com
)
- Go to Cloudflare Workers and create a new Worker
- Copy the content of
worker.js
into the editor - Click
Save and Deploy
Network- and Virtual Switch
-> DDNS
-> Add
-> Select DNS server: Customized
- Username: Your Cloudflare Account email
- Password: Your Cloudflare Global API Key
- Hostname: Your DNS Record (like
my-ddns.example.com
) - URL: Tell your QNAP how to assemble the URL (see below)
https://your.cloudflare.worker.host/route/to/worker?email=%USER%&api_key=%PASS%&record=%HOST%&ip=%IP%&ttl=120
System Controls
-> External Access
-> Customize
System Controls
-> External Access
-> Add
https://your.cloudflare.worker.host/route/to/worker?email=__USERNAME__&api_key=__PASSWORD__&record=__HOSTNAME__&ip=__MYIP__&ttl=120
cURL Command
curl 'https://your.cloudflare.worker.host/route/to/worker?email=cloudflare@email.com&api_key=XXXX&record=my-ddns.example.com&ip=$(curl -s https://ipinfo.io/ip)&ttl=120'
Cronjob every 5 minutes
*/5 * * * * curl 'https://your.cloudflare.worker.host/route/to/worker?email=cloudflare@email.com&api_key=XXXX&record=my-ddns.example.com&ip=$(curl -s https://ipinfo.io/ip)&ttl=120' >/dev/null 2>&1
To get your public IP address you can use the following cURL command:
curl https://ipinfo.io/ip
- Add support for custom DNS settings like
proxied
orauto_ttl
- Add support for automatic SSL certificate renewal
This project is inspire by fbrettnich/cloudflare-dyndns-php. We ported the PHP code to Cloudflare Worker to make it more scalable and easier to use.