« Back to Networking: Frequently Asked Questions

How to see the IP address of your internet connection

There are multiple ways to find out your internet IP address from the command line. One way is using the dig command.

Using dig

With dig we can query the hostname myip.opendns.com. To prevent any intermediate DNS resolver to send an incorrect answer, use the source system.

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

Using curl

Some external websites also provide the IP address. If there is no proxy between you and the related server, it can also provide your IP address.

curl ifconfig.me

Relevant commands in this article

Like to learn more about the commands that were used in this article? Have a look, for some there is also a cheat sheet available.

Other questions related to Networking

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!