$ dig +short myip.opendns.com @resolver1.opendns.com ExplanationThis asks the IP address of If you don't have
LimitationsAll these methods rely on external services, which might be sometimes temporarily or even permanently down. In that case, find an alternative service. |