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 computer in one line. If you have only one network connection, you'll see one address — usually something like 192.168.1.100 or 10.0.0.50.

That's the command most people need. It works on every Linux distribution and shows the result instantly. If you want more detail about which address belongs to which network connection, keep reading.

Key Takeaways

  • Type hostname -I in a terminal to see all your IP addresses at once.
  • Use ip addr show to see IP addresses alongside the network device names they're attached to.
  • The ifconfig command works on older Linux systems but is being phased out in favor of ip.
  • Your IP address starting with 192.168 or 10.0 is a private address used only on your local network.
  • To find your public IP address (what websites see), you need a different command or an online tool.

Using ip addr show to see which device has which address

Type ip addr show and press Enter. This displays every network device on your computer and the IP address attached to each one. You'll see entries labeled eth0, wlan0, lo, or similar — these are your network devices. The lo device is your loopback address (127.0.0.1) and is only for your computer talking to itself.

Look for the line that says inet followed by an IP address. That's your IPv4 address. If you see inet6, that's your IPv6 address — a newer format that looks like 2001:db8::1. Most home networks use IPv4, but both may be present.

This command is more detailed than hostname -I because it shows you exactly which network connection (ethernet, WiFi, virtual, etc.) has which address. If your computer has multiple network cards, you'll see all of them listed separately.

Finding your IP address with ifconfig (older systems)

On some older Linux distributions, ifconfig still works. Type it and press Enter. The output looks similar to ip addr show but in a different format. Look for the line labeled inet — that's your IP address.

Most newer Linux systems have moved away from ifconfig because ip is more powerful and flexible. If ifconfig doesn't work, your system probably uses ip addr show instead. There's no harm in trying — if the command doesn't exist, you'll get an error message telling you so.

Understanding private vs. public IP addresses

The address you see from hostname -I or ip addr show is almost always a private IP address. These start with 192.168, 10.0, or 172.16 and only work on your local network. Your router assigns these addresses to devices on your WiFi or ethernet. Other people on the internet cannot reach you using a private IP address.

Your public IP address is what websites and servers on the internet see when you connect to them. This is assigned by your internet service provider and is different from your private address. To find your public IP, you can type curl ifconfig.me in a terminal, or visit a website like whatismyipaddress.com in your browser.

For most tasks — sharing files with someone on your home network, setting up a local server, or troubleshooting connection problems — you need your private IP address. You only need your public IP if you're trying to connect to your computer from outside your home network.

Checking a specific network device

If you want to see the IP address of just one network device, type ip addr show eth0 (replace eth0 with your device name). This shows only that device's information, which is useful if your computer has many network connections and you want to focus on one.

Common device names are eth0 or eth1 for ethernet, wlan0 or wlan1 for WiFi, and docker0 or veth for virtual networks. If you're not sure which device you need, run ip addr show without a device name to see them all, then pick the one you want to examine more closely.

Viewing IP address in the graphical interface

If you prefer not to use a terminal, most Linux desktop environments show your IP address in the network settings. Look for a network or WiFi icon in the system tray (usually the top-right corner), click it, and select "Connection Information" or "Network Settings." The IP address appears in a window labeled "IPv4 Address" or similar.

The exact steps vary depending on whether you use GNOME, KDE, Cinnamon, or another desktop environment, but the principle is the same: find the network icon, open settings, and look for the address information. This method is slower than typing a command but doesn't require remembering the terminal syntax.

Frequently Asked Questions

Why do I see multiple IP addresses when I run hostname -I?

Your computer has multiple network devices — perhaps ethernet and WiFi both connected, or a virtual network for Docker or virtual machines. Each device gets its own IP address. Use ip addr show to see which address belongs to which device, then use the one that matches the connection you care about.

Can I change my IP address?

Yes, but it depends on your setup. If your router assigns addresses automatically (DHCP), you can usually release and renew your address by restarting your network device or router. If you need a permanent fixed address, you can configure a static IP in your network settings, though this requires knowing your router's gateway and DNS servers.

What does 127.0.0.1 mean?

That's your loopback address, assigned to the lo device. It's a special address your computer uses to talk to itself. Programs running on your machine can connect to services on 127.0.0.1 without going through your network card. You don't need this address to connect to other computers.

Is my private IP address the same every time I restart?

Usually not. Most home routers assign addresses dynamically, so your address may change when you restart. If you need the same address every time, you can set a static IP in your network settings or reserve an address in your router's DHCP settings.

Why does the terminal command show a different address than my router's admin page?

Your router's admin page shows the address your router thinks it assigned to you, while the terminal shows what your computer actually has. These should match, but if they don't, your computer may not have received the address properly. Try restarting your network device or router to force a fresh assignment.