oznu/docker-cloudflare-ddns

Improper DIG Error Handling For IPv4

Perplex opened this issue · 0 comments

Running the following DIG commands from getPublicIpAddress() results in connection time out errors:

$dig +short @1.1.1.1 ch txt whoami.cloudflare +time=3
;; connection timed out; no servers could be reached

$dig +short myip.opendns.com @resolver1.opendns.com +time=3
;; connection timed out; no servers could be reached

Which then translates into update errors:

ERROR: Failed to update CloudFlare DNS record <example>.com from <OLD> to ;; connection timed out; no servers could be reached

The timeouts aren't related to this repo but the error handling does appear to be faulty. After failing the two DIG commands it should fall back to curl -sf4 https://ipinfo.io | jq -r '.ip' (which does work still), but never does.