Get external IP with CLI
curl ifconfig.me
For more options: http://ifconfig.me
Written by Osvaldo Zonetti
Related protips
10 Responses
A new addition to my .bash_aliases ;)
alias myip='curl ifconfig.me'
dig +short myip.opendns.com @resolver1.opendns.com
If you speak JSON then http://httpbin.org
For just the IP I prefer http://icanhazip.com ;)
For json output: curl ifconfig.me/all.json
Better yet use ...
curl http://ifconfig.me/ip
Does not work for me , neither
curl ifconfig.me
nor
curl http://www.ifconfig.me
work
curl ifconfig.me
curl: (52) Empty reply from server
Any idea?
@mrahma01 It's probably some problem in your network: http://stackoverflow.com/questions/1924434/curl-error-52-empty-reply-from-server
Had to share this:
So I curl'd to one of my servers (forgetting what I had set as the index file) and it simply replied with meh
First thought: Did my own server just refuse to tell me something???
And that's the story of how I trolled myself