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

Alternatively, the dig command is faster:

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