ddns-updater: Bug: Cannot get Record ID, Cloudflare DNS
TLDR: Cannot get Record ID, Cloudflare DNS
-
Is this urgent: No
-
DNS provider(s) you use: Cloudflare
-
Program version: Running version latest built on 2021-09-10T22:10:33Z (commit 8b327f8)
-
What are you using to run the container: docker-compose
ddns_updater:
image: qmcgaw/ddns-updater:latest
container_name: ddns_updater
restart: always
volumes:
- $DOCKERDIR/ddns_updater:/updater/data
ports:
- "<EXTENRNAL PORT1>:443/tcp"
- "<EXTENRNAL PORT2>:53/udp"
- "<EXTENRNAL PORT3>:8000/tcp"
networks:
- default
- Extra information (optional) I’ve been trying a few different config.json versions starting with the one in the example here, but it looks like Cloudflare has changed the way they authenticate from when this was written. Either that or I’m just not smart enough to put in the right keys/tokens. I was able to pull my ID using instructions from Cloudflare’s API page which now uses Bearer to authenticate rather than X-Auth-Email and X-Auth-Key as in this documentation. The new call looks like this:
curl -X GET "https://api.cloudflare.com/client/v4/zones/<ZONE ID>/dns_records" \>
-H "Authorization: Bearer <DNS API TOKEN>" \
-H "Content-Type:application/json"
Logs:
INFO Updating record [domain: <DOMAIN> | host: @ | provider: cloudflare | ip: ipv4] to use <IP ADDRESS>
ERROR cannot get record ID: Get "https://api.cloudflare.com/client/v4/zones/<ZONE ID>/dns_records?name=<DOMAIN>&page=1&per_page=1&type=A": net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Configuration file (remove your credentials!):
{
"settings": [
{
"provider": "cloudflare",
"zone_identifier": "<ZONE ID>",
"identifier": "<ID>",
"domain": "<DOMAIN>",
"host": "@",
"ttl": 600,
"token": "<DNS API TOKEN>",
"ip_version": "ipv4",
"proxied": true
}
]
}
Host OS: Ubuntu 20.04
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (10 by maintainers)
Alright, I think I’ll leave it as it is just in case it’s actually used somehow by someone and to avoid breaking compatibility.
87f06eeb2878f9361775e0d975a8403597c69d27 adds documentation on that
host
parameter for Cloudflare and links up to your comment for context, thanks for that. Let’s close the issue for now 😉 Thanks again for your patience and debugging!