2017 07 13 how to find your ip with command line

July 13, 2017

When you need to determine your public IP - eg for a script - you can use some public websites as an API with Curl:

For example, I have used ifconfig.me:

$ curl ifconfig.me
57.22.56.xxx

Alternatively, the dig command is faster:

$ dig +short myip.opendns.com @resolver1.opendns.com
57.22.56.xxx
comments powered by Disqus