Page 1 of 1

Cloudflare

PostPosted: Fri Nov 17, 2023 5:36 pm
by Diejeitor123
Hi:

Its possible to add Cloudflare to DDNS ip updater?

Re: Cloudflare

PostPosted: Thu Nov 23, 2023 6:11 pm
by Diejeitor123
No answer? :please

Re: Cloudflare

PostPosted: Thu Nov 23, 2023 9:31 pm
by fvdw
I will have a look, but can take a while, I am currently busy with home improvement

Re: Cloudflare

PostPosted: Fri Nov 24, 2023 9:34 am
by Jocko
Hi

I just delved a little deeper into the matter and we can not add this DDNS provider because the cloudfare api does not use login method with its ddns update url.

But you can do it easily yourself (I use this way with OVH):

- create a script file, for example in fvdw share by copying the code available from cloudfare site : https://gist.github.com/Tras2/cba88201b17d765ec065ccbedfb16d9a
- update it with your settings (email, zone, your DNS, authenticate key), so lines 11 to 18. Do not put space between '=' and your data (so for example dnsrecord=myDDNS)
! Please note the script must not contain windows break lines. You may get them if you create the file from your laptop.
See https://www.commandlinewizardry.com/post/removing-windows-line-breaks
Then after storing the script in fvdw share and editing it, run this command line
Code: Select all
sed -i 's/\r//' /direct-usb/fvdw/cloudflare-ddns-update.sh
(if you use as file name cloudflare-ddns-update.sh)

- set run permissions on the file
Code: Select all
chmod a+x  /direct-usb/fvdw/cloudflare-ddns-update.sh


- create a cron job to send the request at the frequency you want. When you will add a new job, the related job is the path on the script. So: /direct-usb/fvdw/cloudflare-ddns-update.sh
Of course you have to enable cron permanently