The quickest way to find your IP address in Ubuntu
Open a terminal and type hostname -I, then press Enter. This command displays all IP addresses assigned to your computer on one line. If you have only one network connection, you will see a single address like 192.168.1.100.
If you want more detail about which address belongs to which network interface, type ip addr show instead. This lists every network device on your system — ethernet, WiFi, virtual interfaces — along with its IP address, subnet mask, and connection status.
Both commands work the same way whether you are using Ubuntu on a desktop, laptop, or server. You do not need administrator permissions to run them.
Key Takeaways
- hostname -I is the fastest way to see your IP address; it shows all addresses in a single line.
- ip addr show displays more information, including which network device each address belongs to and whether the connection is active.
- Both commands work in any terminal without requiring sudo or root access.
- Your IP address may change if you use DHCP, so check it again if you reconnect to the network.
- The address starting with 127 is your local loopback and does not connect to other computers.
Understanding what the output means
When you run ip addr show, you see sections labeled with numbers and names like lo, eth0, or wlan0. The lo interface is your loopback — it is how your computer talks to itself and always has the address 127.0.0.1. Ignore it unless you are troubleshooting local services.
The eth0 or enp interfaces are wired ethernet connections. The wlan0 or wlp interfaces are WiFi. Look for the line that says inet followed by a number — that is your IPv4 address, the one most programs use. If you see inet6, that is your IPv6 address, a newer format that some networks use alongside IPv4.
Next to each address you will see a slash and a number like /24 or /16. This is the subnet mask in CIDR notation and tells you how many computers can be on your local network. You usually do not need to worry about this number unless you are setting up a network.
Finding your IP address through the graphical interface
If you prefer not to use the terminal, you can find your IP address in the Settings application. Click the system menu in the top right corner of your screen, then select Settings. Go to Network on the left side.
Click the gear icon next to your active connection — either Wired or WiFi. A details window opens showing your IP address under IPv4 Address. This method shows only the address you are currently using, not all addresses on your system.
The graphical method is slower than the terminal but useful if you are not comfortable typing commands or need to change your network settings at the same time.
Checking your public IP address versus your local IP address
The addresses you see with hostname -I or ip addr show are your local IP addresses — they work only on your home or office network. Devices outside that network cannot reach you using these addresses.
Your public IP address is assigned by your internet service provider and is what websites see when you connect to them. To find your public IP, you can type curl ifconfig.me in the terminal, or visit a website like ifconfig.co in your browser. This address changes periodically unless you pay for a static IP.
For most purposes — connecting to other computers on your network, setting up a local server, or troubleshooting network problems — you need your local IP address. You only need your public IP if you are hosting a service that people outside your network need to reach.
What to do if you see multiple IP addresses
Ubuntu can have more than one IP address if you have multiple network devices, virtual machines running, or Docker containers installed. Each one gets its own address. The ip addr show command shows all of them grouped by interface.
If you are looking for the address of a specific device — your WiFi connection, for example — find the section labeled wlan0 or similar and look for the inet line within that section. Ignore addresses from other interfaces unless you are specifically trying to reach them.
If you recently installed virtualization software and see unfamiliar interfaces like docker0 or vnet0, those are virtual network devices created by that software. Your actual connection to the internet still comes through eth0 or wlan0.
Checking if your IP address is static or dynamic
A static IP address stays the same every time you restart your computer or reconnect to the network. A dynamic IP address is assigned by your router using DHCP and may change. Most home networks use dynamic addresses.
To see which type you have, open Settings, go to Network, and click the gear icon next to your connection. Look for a section labeled IPv4 or DHCP. If it says "Automatic (DHCP)", your address is dynamic. If it shows a specific address with no DHCP option, it is static.
You can also set a static address here if you need your computer to always have the same IP. This is useful if you are running a server or need other devices to reliably find your computer. Most users do not need to change this setting.
Frequently Asked Questions
Why does my IP address start with 192.168 or 10.0?
These ranges are reserved for private networks and are used by routers to assign addresses to devices on your home or office network. Every router uses these same ranges, so your address is unique only within your network, not across the entire internet. Your public IP address, assigned by your internet provider, is different.
Can I change my IP address in Ubuntu?
Yes, but most of the time you should not. If you need a static address instead of a dynamic one, you can set it in Settings under Network. If you need to change it temporarily for troubleshooting, you can restart your router or use terminal commands, but the change usually does not last after a reboot.
What if hostname -I shows nothing or an error?
This usually means your network connection is not active. Check that your ethernet cable is plugged in or your WiFi is connected. If you are connected but still see nothing, your network may not have assigned you an address yet. Wait a few seconds and try again, or restart your network connection in Settings.
Is my IP address the same as my MAC address?
No. Your IP address is like your mailing address — it changes based on your network. Your MAC address is like your serial number — it is built into your network hardware and stays the same. You can find your MAC address in the same Settings window where you see your IP address, listed as "Hardware Address."