mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
250 stars 25 forks source link

Cloudflare record update fails #24

Closed Gandulf78 closed 2 years ago

Gandulf78 commented 2 years ago

Hi. I am trying to use your module to update my DNS records with caddy but it fails. Here are the logs:

"level":"info","ts":1650453680.2739289,"logger":"dynamic_dns","msg":"updating DNS record","zone":"mydomain.fr","type":"A","name":"test","value":"myip","ttl":1800} {"level":"error","ts":1650453681.071767,"logger":"dynamic_dns","msg":"failed setting DNS record(s) with new IP address(es)","zone":"mydomain.fr","error":"got error status: HTTP 400: [{Code:6003 Message:Invalid request headers}]"}

Here is the global section of my caddyfile :

{ debug
dynamic_dns { provider cloudflare {env.CLOUDFLARE_API_TOKEN} domains { mydomain.fr test } } } Otherwise I succeed to get my TLS certificates updated (ACME DNS challenge) from Cloudflare. I suppose it may be a credential issue. Could you please help?

Thank you.

mholt commented 2 years ago

(For future searchers) Resolved in https://caddy.community/t/issue-with-caddy-dynamicdns/15703 -- API token was wrong.