Last Updated: August 01, 2023
·
3.736K
· Osvaldo Zonetti

Get external IP with CLI

curl ifconfig.me

For more options: http://ifconfig.me

10 Responses
Add your response

A new addition to my .bash_aliases ;)

alias myip='curl ifconfig.me'
over 1 year ago ·

dig +short myip.opendns.com @resolver1.opendns.com

over 1 year ago ·

If you speak JSON then http://httpbin.org

over 1 year ago ·

For just the IP I prefer http://icanhazip.com ;)

over 1 year ago ·

For json output: curl ifconfig.me/all.json

over 1 year ago ·

Better yet use ...

curl http://ifconfig.me/ip
over 1 year ago ·

Does not work for me , neither
curl ifconfig.me
nor
curl http://www.ifconfig.me
work

over 1 year ago ·

curl ifconfig.me
curl: (52) Empty reply from server

Any idea?

over 1 year ago ·

@mrahma01 It's probably some problem in your network: http://stackoverflow.com/questions/1924434/curl-error-52-empty-reply-from-server

over 1 year ago ·

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

over 1 year ago ·