oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.08k stars 219 forks source link

Improper DIG Error Handling For IPv4 #92

Open Perplex opened 2 years ago

Perplex commented 2 years ago

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.