K0p1-Git / cloudflare-ddns-updater

Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH~
MIT License
1.33k stars 371 forks source link

Support for multiple records [Reference @jeidnx comment on 24th Jan] #57

Open Jeidnx opened 1 year ago

Jeidnx commented 1 year ago

Hey there, Should this project support updating multiple records? This would involve either changing the record_name variable to record_names or having a second variable for multiple records altogether, although i don't see the point in that. I have already implemented this in a custom version of this script i use here.

Wizman87 commented 1 year ago

Wouldn't using a CNAME be more ideal than updating multiple records, all at once? Also, running multiples of the same script would achieve the same result for different records, zones, and domains. Thoughts?

Wizman87 commented 1 year ago

Duplicate of https://github.com/K0p1-Git/cloudflare-ddns-updater/issues/40, https://github.com/K0p1-Git/cloudflare-ddns-updater/issues/33, and https://github.com/K0p1-Git/cloudflare-ddns-updater/issues/22. Please be sure to review these other closed issues for alternative solutions and additional related discussion topics.

Jeidnx commented 1 year ago

None of these issues where closed with an answer as to whether this script should support multiple domains, they are all just workarounds. This issue is intended to be a discussion about exactly this.

Some of my thoughts: Yes, using a CNAME is probably the best solution for most if not all cases. I personally just really dislike using CNAMEs, as they often lead to unintended behavior in my experience. Running multiples of the same script is also a valid solution (which, unlike my referenced implementation, works across multiple cloudflare zones), but I would much prefer having all the dns related things in a single file.

In my opinion adding multi domain support is unnecessary for this project. You already pointed out two good solutions to this problem.

My intention was to give a definitive yes or no answer to the question if this project will ever support multiple domains or not. I suggest we wait for @K0p1-Git to be available again to hear his thoughts on this.

K0p1-Git commented 1 year ago

My intended use case for this script was for a simple home server and thus created a script that can be easily used and lightweight. I'll keep this issue up for those that share the same need as you, where they would be able to find access to the version of the script you've created. Thanks! @Wizman87

Neo-ST commented 6 months ago

My intended use case for this script was for a simple home server and thus created a script that can be easily used and lightweight. I'll keep this issue up for those that share the same need as you, where they would be able to find access to the version of the script you've created. Thanks! @Wizman87

Hi,

I'm having a similar but different issue. I have 2 different domains on Cloudflare and I have 2 physically separate web servers that I wanted to connect to those domains. I succeeded to connect the 1st one, and script is working nicely.

But it won't update the 2nd server's IP addresses to Cloudflare.

Bear in mind I don't have subdomains, I have 2 separate .com domains in my Cloudflare account.

In each, I created "A" DNS record.

The one thing I noticed could be causing problems is "Global API key". Zone identifiers for these 2 domains are different, but Global API key is the same, so I think that's what's confusing the script, because it successfully always updates only the 1st domain, while 2nd one never gets updated.

Is there a workaround to this?

Thanks for your time and work!

Sailboat265 commented 6 months ago

@Neo-ST Hello! You should actually start a new issue thread for this.

But never mind! Alright back to your problem. Sorry, I can't test this out because I don't have more than one domains on Cloudflare.

However, ifaik, Global API key should have no problem with this. Because it's just a method of authenticating the request to Cloudflare servers, it shouldn't affect the response outcome.

I assume you're running two scripts already right? If so, can you please double check the parameters like auth_email, zone_identifier, record_name and etc, on your second script.

I think this could be a misconfiguration issue.

Neo-ST commented 6 months ago

@Neo-ST Hello! You should actually start a new issue thread for this.

But never mind! Alright back to your problem. Sorry, I can't test this out because I don't have more than one domains on Cloudflare.

However, ifaik, Global API key should have no problem with this. Because it's just a method of authenticating the request to Cloudflare servers, it shouldn't affect the response outcome.

I assume you're running two scripts already right? If so, can you please double check the parameters like auth_email, zone_identifier, record_name and etc, on your second script.

I think this could be a misconfiguration issue.

OMG I'm such an idiot. Immediately when I saw "auth_email" I remembered I screwed up. I mistakenly entered another email address instead of one I used to register with Cloudflare, and of course the script couldn't work. It now works.

Thank you!

Sailboat265 commented 6 months ago

@Neo-ST No worries! It happens to the best of us. Glad the script is working well for you.

If you have time, perhaps can try out introducing IPv6 (cloudflare-templatev6) too? 😆

Neo-ST commented 6 months ago

@Neo-ST No worries! It happens to the best of us. Glad the script is working well for you.

If you have time, perhaps can try out introducing IPv6 (cloudflare-templatev6) too? 😆

Sure, but to be honest, I'm a newbie to all this. Not sure what is that template for and do I even need it ?

Sailboat265 commented 6 months ago

Oh that script is basically same as (cloudflare-template.sh). But it deals with IPv6 updating specifically. If your servers don't need IPv6 connectivity, then you don't need it.