Occasionally, I need to look up my own public IP for various reasons. To do this, I would google “what is my ip”, and got a result on the browser.
Recently, I found a way to easily do this using curl
command to an easy to remember URL ifconfig.io
.
Here is an example, of course with the fake IPs as the results:
➜ curl ifconfig.io
2444:3444:20a:5310:d6c9:ffff:fef1:7777
To get the IPv4, we can supply the -4
option to curl
command:
➜ curl -4 ifconfig.io
111.77.33.222
Apart from ifconfig.io
, there are also a bunch of other URLs which you can curl
to, e.g. ipconfig.io
. However, for me this, one is enough and easy to remember.