John Bohn

My thoughts on software, tech, business, and more

How to get your public IP address from the terminal

Came across this little command the other day. This does a simple GET request to, which returns your IP address.


There are also a few other commands that can give you other information including your hostname, user agent, etc. You can get it return in json, xml or plain text. I encourage you to checkout on the web to see them all.

There are a few services to retrieve your public facing IP address, but I think this one is the nicest/easiest to remember.