Environment
-
Device: Teltonika RUTX50
-
Firmware:
RUTX_R_00.07.20.3(build date2026-01-21) -
DDNS provider:
cloudflare.com-v4 -
Auth method: Cloudflare API Token using
Authorization: Bearer <token> -
Domain format:
host@domain.tld(e.g.r4@example.ch) -
lookup_host:
r4.example.ch(A record)
Issue
Cloudflare DDNS zone lookup and DNS record lookup succeed (GET requests include the Bearer authorization header), but the record update (PUT) fails.
Cloudflare returns:
{"success":false,"errors":[{"code":9106,"message":"Missing X-Auth-Key, X-Auth-Email or Authorization headers"}]}
Verbose output shows the Authorization header is present on GET calls but missing on the PUT call.
Root cause
In:
/usr/lib/ddns/update_cloudflare_com_v4.sh
Inside cloudflare_transfer() the script overwrites the curl argument list when data is provided:
[ -n "$__DATA" ] && set -- "--data" "@$__DATA"
This replaces all previously appended args (including --header Authorization: Bearer ..., --header Content-Type: application/json, --request PUT, --cacert, etc.), so the PUT request is sent without auth headers.
Fix (one-liner)
Change the overwrite to an append:
[ -n "$__DATA" ] && set -- "$@" "--data" "@$__DATA"
Workaround
/usr/lib is on a read-only filesystem, so a workaround is to:
-
Copy the script to a writable location (e.g.
/root/...), -
Apply the one-line fix,
-
Bind-mount the fixed script over the original:
mount --bind <fixed_script> /usr/lib/ddns/update_cloudflare_com_v4.sh
After applying the fix, the PUT request includes the Authorization header and the DDNS update succeeds.
Request
Please patch update_cloudflare_com_v4.sh in RutOS / DDNS scripts and include in the next firmware release (hotfix if possible), as this breaks Cloudflare DDNS with API tokens on 00.07.20.3.