mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
records Problem: When using Cloudflare with proxy enabled (orange cloud), DNS lookups return Cloudflare's edge IP instead of the actual origin IP registered in the dashboard. This causes ddns-scripts to incorrectly detect IP mismatches, triggering unnecessary updates and potential rate limiting. Solution: Add an optional 'use_api_check' configuration option that enables provider scripts to fetch the registered IP directly via their API, bypassing DNS lookups. Changes: - dynamic_dns_functions.sh: Add API check block to get_registered_ip() (~25 lines). When use_api_check is enabled, sources the provider script with GET_REGISTERED_IP=1 flag. Falls back to DNS lookup if API check is disabled, unsupported, or fails. - update_cloudflare_com_v4.sh: Add handler for GET_REGISTERED_IP mode (~15 lines). Reuses existing cURL setup and authentication to query Cloudflare API for actual record content. - etc/config/ddns: Document use_api_check option Behavior: - use_api_check=0 or unset: DNS lookup (existing behavior, no changes) - use_api_check=1 with API support: API query for registered IP - use_api_check=1 without API support: Falls back to DNS lookup - API failure: Gracefully falls back to DNS lookup Testing: - Cloudflare (proxied): Correctly retrieves origin IP via API - Cloudflare (non-proxied): Works correctly - No-IP: DNS lookup works (no regression) - IPv4 and IPv6 records tested - API failure gracefully falls back to DNS Signed-off-by: Wayne King 244781262+bdk38@users.noreply.github.com