Janik von Rotz

1 min read

Get public IP with Curl

Getting the public IP of your machine (running in the cloud) is simple. You probably find yourself on the command line and want to check if a DNS entry is resolved correctly. Login into the hoster’s dashboard and checking the public IP there is too much of hassle.

Simply run this command to get the public IP of your machine:

curl ifconfig.me

Example output:

janikvonrotz@cratos ➜  ~ curl ifconfig.me

The website https://ifconfig.me/ simply returns the IP if queried with curl.

You can also run curl ifconfig.me/all to get more details.

Categories: System tooling
Tags: linux , curl , ipv4
Improve this page
Show statistic for this page