In DSM 5.2, I use tehmantra script to update Cloudflare DNS. It works great. However due to modified system files, every week DSM send an email to me, report that malware detected in my DSM...
Recently upgraded to DSM 6.0. Those new features are so damn cool (customized domain; Let's Encrypt; Reverse Proxy). After that, I found those Cloudflare DNS update script is being removed by the system.
Instead of hack again, I try to find a new way to update my DNS.
Study the shell script from gist, it actually just using
curl command to call Cloudflare API. Follow the instruction in that page, I come up with a complete URL for updating my DNS.
curl --silent "https://www.cloudflare.com/api_json.html?a=rec_edit&tkn=__GLOBAL_API_KEY__&email=__EMAIL__&z=__ZONE__&content=__MYIP__&type=A&id=__REC_ID__&name=__REC_NAME__&ttl=1&service_mode=0"
I try to access this URL in my browser. It does update my IPv4 address. It works!
So I base on above URL, to config customize DDNS in DSM, but it fails to update with unknown reason...
Suddenly I realize that there is a Task Scheduler feature, which able to run linux command! I change
curl --silent ipecho.net/plain ; echo to get my IPv4 address. Create a new task, put the command User-defined script text area.
Set it to run every 5 mins.
Prefect! Works like magic.