What's new

Using Cloudflare for DDNS

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

TexasDave

Occasional Visitor
I want to use Cloudflare for my DDNS. I believe I need to use a ddns-start script - Yes?

If I have two domains at Cloudflare, do I just copy the script twice into one file and run the same script code twice but subsituting the proper ZONE_ID, RECORD_NAME, RECORD_TTL,API_TOKEN for each domain?

Or is there a better way? I see there are some other script files out there as well. Any of these used widely or prefered to the above? And can I register my IP twice in the same script?

Thank you!
 
I want to use Cloudflare for my DDNS. I believe I need to use a ddns-start script - Yes?

If I have two domains at Cloudflare, do I just copy the script twice into one file and run the same script code twice but subsituting the proper ZONE_ID, RECORD_NAME, RECORD_TTL,API_TOKEN for each domain?

Or is there a better way? I see there are some other script files out there as well. Any of these used widely or prefered to the above? And can I register my IP twice in the same script?

Thank you!
I use Cloudflare for my domain, updating via dns-o-matic (which is a built-in option for Merlin F/W)
 
I want to use Cloudflare for my DDNS. I believe I need to use a ddns-start script - Yes?
Yup, with the DDNS server set to custom in the WebUI. Or via dns-o-matic as Jack Yaz mentioned.

If I have two domains at Cloudflare, do I just copy the script twice into one file and run the same script code twice but subsituting the proper ZONE_ID, RECORD_NAME, RECORD_TTL,API_TOKEN for each domain?
Just to be sure, you want both domains to point to your router? If so then yes, but only run the /sbin/ddns_custom_updated part once at the end.

Or is there a better way? I see there are some other script files out there as well. Any of these used widely or prefered to the above? And can I register my IP twice in the same script?
It's pretty much personal preference, some people find extra scripts easier to use, especially if they're doing more complicated stuff like handling the response code properly. The IP registration is just a curl command, so there's no reason you can't update as many domains as you like in a script.
 
Many thanks - went with dns-o-matic. All sorted!
 
Please give it a try (dnsomatic updater)
Code:
/usr/sbin/curl -s --retry 3 https://raw.githubusercontent.com/maghuro/stuff/master/dnsomatic -o /jffs/scripts/dnsomatic && chmod 755 /jffs/scripts/dnsomatic && ln -s /jffs/scripts/dnsomatic /opt/bin/dnsomatic

For the first run:
Code:
dnsomatic set USERNAME YourUsername
dnsomatic set PASSWORD YourPassword
dnsomatic set HOSTNAME YourHostname (usualy all.dnsomatic.com)

Then, list of available commands:
Code:
dnsomatic config # list of contents of config file
dnsomatic cron X # creates the cronjob, where X is the number of minutes for each IP check
dnsomatic init # you can use it on wan-event connected, for example. The only thing it does is to give a 30s sleep before first update
dnsomatic force # forces an update even if the current IP is the same
dnsomatic force 11.11.11.11 country # forces an update to the given IP. Country is optional
Thanks @Jack Yaz for the Print_Output code.

It's pretty simple, and very badly coded, but hey.. it works!

I recommend to add the following line on services-start:
Code:
/jffs/scripts/dnsomatic cron 5 #dnsomatic cronjob
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top