The fastest way to see your IP address on Linux
Open a terminal and type hostname -I, then press Enter. This command shows 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, use ip addr show instead. This lists every network connection on your PC, the type of connection, and the IP address for each one. The output is longer but tells you exactly which interface is which.
Both commands work on any Linux distribution without installing anything extra. They run when ready and show your current IP address as it exists right now.
Key Takeaways
- hostname -I is the quickest way to see all your IP addresses in one line.
- ip addr show displays every network interface and its IP address with additional details.
- Both commands work in any terminal without needing extra software or administrator permission.
- Your IP address may change if you use DHCP, so check it again if you reconnect to the network.
- The address starting with 192.168 or 10.0 is your local network address; addresses starting with 127 are internal only.
Understanding what the output means
When you run hostname -I, you see numbers separated by spaces. Each number is an IP address. Most home and office PCs show one address, which is your local network IP. This is the address other devices on your network use to reach your PC.
If you run ip addr show, you see sections labeled with names like eth0, wlan0, or lo. The eth0 or wlan0 is your actual network connection. The lo section is the loopback address (127.0.0.1), which is internal to your PC only and not useful for connecting from other devices.
Look for the line that says inet followed by a number. That number is your IPv4 address. If you see inet6, that is your IPv6 address, which is a newer format but works the same way.
Using the GUI if you prefer not to open a terminal
Most Linux desktop environments show your IP address in the network settings menu. Click the network icon in your system tray (usually in the top right or bottom right corner), then look for a settings or details option. The exact steps depend on whether you use GNOME, KDE, Cinnamon, or another desktop, but all of them have a network settings panel that displays your IP address.
This method takes longer than typing a command, but it shows the same information in a visual format. You can also see whether you are connected by WiFi or ethernet, and whether the connection is active.
Why your IP address might change
If your PC uses DHCP (which most do), your IP address can change when you restart your computer or reconnect to the network. This is normal. Your router assigns a new address from its available pool each time you connect.
If you need the same address every time, you can set a static IP address in your network settings. This tells your PC to always use one specific address instead of asking the router for a new one each time. The steps to do this vary by Linux distribution, but the network settings menu is where you make the change.
Finding your public IP address instead
The addresses shown by hostname -I and ip addr show are your local network addresses. They work only on your home or office network. If you need your public IP address (the one the internet sees when you visit a website), you cannot find it on your PC alone.
To see your public IP, open a web browser and visit a site like whatismyipaddress.com or similar. These sites show the address your internet service provider assigned to your router. Your PC itself does not know this address; only your router does.
Checking a specific network interface
If your PC has multiple network connections and you want to check only one, use ip addr show eth0 (replace eth0 with the name of the interface you want). This shows only that interface and its IP address.
To see which interfaces exist on your PC, run ip link show. This lists every network connection, whether it is active or not. Look for the ones labeled eth0, wlan0, or similar. The lo interface is loopback and can be ignored.
Frequently Asked Questions
What is the difference between hostname -I and ip addr show?
hostname -I shows only the IP addresses in a straightforward list. ip addr show shows the same addresses but also displays the network interface names, connection types, and other details. Use hostname -I for speed; use ip addr show when you need to know which address belongs to which interface.
Why do I see multiple IP addresses?
Your PC may have more than one network connection active at the same time, such as both WiFi and ethernet. Each connection gets its own IP address. You can also have virtual network interfaces created by software. Run ip addr show to see which address belongs to which interface.
Can I change my IP address?
Yes. If you use DHCP, restart your PC or disconnect and reconnect to the network to request a new address from your router. If you want a permanent static address, open your network settings, find the connection, and switch it from automatic (DHCP) to manual, then enter the address you want.
Is my local IP address the same as my internet IP?
No. Your local IP (192.168.x.x or 10.0.x.x) works only on your home network. Your internet IP is assigned by your internet service provider and is seen by websites you visit. Check your internet IP on a website like whatismyipaddress.com.
Do I need administrator permission to see my IP address?
No. Any user on the PC can run hostname -I or ip addr show without special permissions. These commands only read information; they do not change anything on your system.