How To Check Your IP Address in Ubuntu [Beginner's Tip]

Wonder what’s your IP address? Here are several ways to check IP address in Ubuntu and other Linux distributions.

Checking your IP Address in Ubuntu [Terminal Method]

The fastest and the simplest way to check your IP address is by using the ip command. You can use this command in the following fashion:

ip a

Actually, it’s short for this:

ip addr show

Both commands show the same output. They will show you both IPv4 and IPv6 addresses:

Display IP Address in Ubuntu Linux
Display IP Address in Ubuntu Linux

If you prefer to get minimal details, you can also use hostname command:

hostname -I

It will just give the IP address of the system. Nothing else.

hostname ip address
Hostname only shows IP address

There are some other ways to check IP address in Linux but these two commands are more than enough to serve the purpose.

What about ifconfig?

Long-time users might be tempted to use ifconfig (part of net-tools), but that command is deprecated. Some newer Linux distributions don’t include this package anymore and if you try running it, you’ll see ifconfig command not found error.

Checking IP address in Ubuntu [GUI Method]

If you are not comfortable with the command line, you can also check IP address graphically.

Open up the Ubuntu Applications Menu (Show Applications in the bottom-left corner of the screen) and search for Settings and click on the icon:

Applications Menu Settings
Applications Menu Settings

This should open up the Settings Menu. Go to Network:

Network Settings Ubuntu
Network Settings Ubuntu

Pressing on the gear icon next to your connection should open up a window with more settings and information about your link to the network, including your IP address:

IP Address GUI Ubuntu
IP Address GUI Ubuntu

You can see the IP address of your router as well in the above screenshot. It’s displayed with “Default Route”.

Bonus Tip: Checking your Public IP Address (for desktop computers)

First of all, to check your public IP address (used for communicating with servers etc.) you can use curl command. Open up a terminal and enter the following command:

curl ifconfig.me

This should simply return your IP address with no additional bulk information. I would recommend being careful when sharing this address, since it is the equivalent to giving out your personal address.

Note: If curl isn’t installed on your system, simply use sudo apt install curl -y to install curl on Ubuntu based Linux distributions.

Another simple way you can see your public IP address is by searching for ip address on Google.

Summary

In this article I went through the different ways you can find your IP address in Uuntu Linux, as well as giving you a basic overview of what IP addresses are used for and why they are so important for us.

I hope you enjoyed this quick guide. Let us know if you found this explanation helpful in the comments section!

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.