(Day 8 of 30 Days of Blogging)
Sometimes you need to determine your own IP address. There’s
ip addr (the new
will tell you your local network IP. What about your external Internet-addressible IP? Use this:
dig @resolver4.opendns.com myip.opendns.com +short
This is faster than
curl icanhazip.com or equivalent URLs, and more reliable too.