diff --git a/web/whatismyip b/web/whatismyip index 33ae705..26a86ad 100755 --- a/web/whatismyip +++ b/web/whatismyip @@ -14,7 +14,7 @@ function locals_only() { } function ifconfig_service() { which curl &>/dev/null && { - curl ifconfig.co/json; exit $? + curl -4 ifconfig.co/json; exit $? } which wget &>/dev/null && { wget -q -O - ifconfig.co/json; exit $? @@ -46,6 +46,9 @@ which dig &> /dev/null || { IP=$( dig +short myip.opendns.com @resolver1.opendns.com ) +if [[ -z "$IP" ]]; then + IP=$( curl -s -4 ifconfig.co/ip ) +fi if [[ "$NAME" -eq 1 ]]; then output=$( dig +short -x "$IP" )