24071 shaares
Add these alias to your shell startup and you can find your public IPv4 or IPv6 without visiting any 3rd party web site from your Linux, macOS or Unix machine:
alias what_is_my_ip='dig +short txt ch whoami.cloudflare @1.0.0.1'
alias what_is_my_ip_v4='what_is_my_ip'
alias what_is_my_ip_v6='dig -6 TXT +short o-o.myaddr.l.google.com @ns1.google.com'
Run it as:
what_is_my_ip
what_is_my_ip_v4
what_is_my_ip_v6