Public IP lookup from CloudFlare DNS
I wanted a quick way to grab my public IP address from the command line. I
found that CloudFlare’s DNS service allows this by looking up TXT records for
whoami.cloudflare
.
dig @1.1.1.1 ch txt whoami.cloudflare +short | tr -d '"'