Closed aybab2 closed 5 months ago
debug your API tokens. not a script issue
Appreciate your script, and the response. However the problem does lie within the script. Cloudflare assigns a unique Zone-ID to each individual domain. This script only allows one Zone-ID to be passed for ALL domains, and that is why cloudflare is not allowing this script to update more than one domain. In addition, the README says to create a zone-specific API token, this by design would not allow the API to update more than one zone. A little tweaking and we can get this script to update multiple zone's. It will need another function to accept a comma separated list of zone-ID's that need to be ordered corresponding to the list of domains. This will allow the PUT methods in your curl command to edit the correct zoneID for each domain. We could also then create only 1 zone-API-token which has permission across all zones. This is the most efficient path forward. Will tinker in spare time and then fork once completed. Thank you, cheers!
cloudflare User API Token:
update-coudflare-dns.conf:
CONDITION NORMAL (all DNS records have correct IP): update-cloudflare-dns-log:
CONDITION IP CHANGED: update-cloudflare-dns-log:
STEPS TAKEN: Tried adding zoneID-of-url-2 as follows:
RESULTS:
I'm assuming only one zoneid should be entered in the conf.
Or perhaps both zoneid's need to be listed.
Or perhaps the domains need to be in same zone.
Any tips?