The fastest way to see your IP address

Open a terminal and type hostname -I, then press Enter. This shows all IP addresses assigned to your machine in one line. If you have only one network connection, you will see one address — usually something like 192.168.1.50 or 10.0.0.25.

This is the command to use first because it is the simplest and works on every Linux system. It shows only the addresses, nothing else, so you get an answer in under a second.

If hostname -I returns nothing or an error, your system may be older or configured differently. Move to the next section to use the more detailed command that works everywhere.

Key Takeaways

  • Type hostname -I in a terminal to see your IP address when ready — this works on all Linux systems and is the fastest method.
  • Use ip addr show if you need to see which network device (like eth0 or wlan0) each address belongs to, or if the first command does not work.
  • Your IP address starting with 192.168, 10.0, or 172.16 is a private address used only on your home network and cannot reach the internet directly.
  • The ifconfig command still works on many systems but is older and may not be installed on newer Linux versions.
  • Check your IP address before setting up port forwarding or static addresses, because you need to know which device you are configuring.

Understanding what the output means

When you run hostname -I, you see one or more addresses separated by spaces. Each address has four numbers between 0 and 255, separated by dots — for example, 192.168.1.50. This is called an IPv4 address, and it is what your router assigns to your machine on your home network.

If you see an address starting with 192.168, 10.0, or 172.16, that is a private address. It works only on your home network. Your router translates it when you send traffic to the internet, so websites and services see your router's address instead.

You may also see an address starting with 127 (like 127.0.0.1). This is the loopback address — it points to your own machine and is used for testing. You can ignore it for network setup.

Using ip addr show for more detail

Type ip addr show and press Enter. This command displays every network device on your machine and all addresses assigned to each one. The output is longer than hostname -I, but it tells you which address belongs to which device.

Look for lines that start with a number and a colon (like "2: eth0:" or "3: wlan0:"). These are your network devices. eth0 usually means a wired connection, and wlan0 usually means Wi-Fi. Below each device name, you will see "inet" followed by an address — that is the IPv4 address for that device.

This command is useful when you have multiple network connections and need to know which address belongs to which one. It also shows whether each device is up (active) or down (inactive), which helps you troubleshoot connection problems.

Finding your IP address through the graphical interface

If you prefer not to use the terminal, most Linux desktop environments show your IP address in the network settings. Click the network icon in the top right or bottom right corner of your screen — it usually looks like a Wi-Fi symbol or a plug.

Select "Connection Information" or "Network Settings" from the menu. A window will open showing your current connection and its IP address. The exact wording and location varies by desktop environment (GNOME, KDE, Xfce), but the network icon is the same starting point on all of them.

This method is slower than typing a command, but it does not require you to remember any syntax. Use it if you only need to check your address once and do not plan to do this regularly.

Why you need to know your IP address

Your IP address is the identifier that lets other machines on your network find yours. When you set up port forwarding on your router (to run a server or game), you enter your machine's IP address so the router knows where to send incoming traffic. If you set a static address later, you start with the address you see now.

Knowing your IP address also helps you troubleshoot network problems. If a device cannot reach your machine, you can verify the address is correct and check whether the machine is actually on the network. It is also the first thing to check if you suspect a network conflict — two devices with the same address will cause both to lose connection.

Static addresses versus dynamic addresses

The address you see right now is usually assigned by your router and can change. Your router hands out addresses automatically using DHCP, and when your machine reboots or loses connection, it may get a different address the next time it connects.

If you are setting up a server or want a device to always have the same address, you can set a static address in Linux itself or reserve an address on your router. A reserved address (set on the router) is usually easier because your router remembers it and always gives that address to that machine. A static address set in Linux works even if you move the machine to a different network, but it requires editing configuration files.

For most home network setups, the dynamic address you see now is fine. You only need a static address if you are running a service that other machines need to reach at a specific address, or if you are setting up port forwarding.

Checking your external IP address

The address you see with hostname -I or ip addr show is your internal address — it works only on your home network. Your external IP address is what the internet sees, and it belongs to your router, not your machine.

To find your external IP address, open a web browser and search for "what is my IP" or visit a site like whatismyipaddress.com. The address shown is what websites and online services see when you connect to them. Your router translates between your internal address and this external one.

You need your external IP address if you are setting up remote access to your home network or if you want to know your location as the internet sees it. You do not need it for most home network tasks.

Frequently Asked Questions

What if hostname -I shows nothing?

Your machine may not be connected to the network, or the command may not work on your system. Try ip addr show instead — it works on all modern Linux systems. If that also shows no addresses, check that your network cable is plugged in or that Wi-Fi is turned on.

Can I change my IP address?

Yes, but it will change back when you reboot unless you set it as static. Most home users should not change it — let your router assign addresses automatically. If you need a specific address for a service, reserve it on your router instead, which is simpler and more reliable.

Why do I see multiple IP addresses?

You may have multiple network devices (wired and Wi-Fi), or your machine may have multiple addresses on the same device. Use ip addr show to see which address belongs to which device. Usually only one is active at a time, and that is the one you use for your network.

Is my IP address private or public?

If it starts with 192.168, 10.0, or 172.16, it is private — it works only on your home network. Your router has a public address that reaches the internet. Websites see your router's public address, not your machine's private address.

Do I need to write down my IP address?

Only if you are setting up port forwarding or a static address. For normal use, you do not need to remember it. Your router and other machines on your network find each other automatically.