The fastest way to see your IP address in Linux

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. If you have multiple connections — ethernet, WiFi, virtual networks — you will see all of them listed together.

This command works on nearly every Linux distribution without installing anything extra. It is the quickest path when you just need the number itself and do not need to know which address belongs to which network card.

If hostname -I returns nothing or an error, your system may not have a network connection active, or your distribution may not include the hostname command. Move to the next section for the alternative that works everywhere.

Key Takeaways

  • Type hostname -I in a terminal to see all your IP addresses at once — this is the fastest method on most Linux systems.
  • Use ip addr show to see IP addresses alongside the network card names and connection status, which helps when you have multiple connections.
  • The ifconfig command shows the same information as ip addr show but is older and not installed on newer distributions by default.
  • Your IP address may change if you use DHCP, so check it again after restarting your computer or reconnecting to the network.
  • The address starting with 127 is your local machine only and cannot reach other computers — your real network address will be different.

Viewing IP addresses with network card names

Type ip addr show in the terminal and press Enter. This displays every network card on your machine, the IP address assigned to each one, and whether each connection is active or inactive. You will see output organized by card name — usually lo for your local machine, eth0 or enp0s3 for ethernet, and wlan0 or wlp3s0 for WiFi.

Look for the line that says inet followed by a number with dots in it — that is your IPv4 address. If you see inet6 instead, that is an IPv6 address, which is a newer format. Most home networks still use IPv4, but your machine may have both.

The ip addr show command is installed on all modern Linux distributions. It is more detailed than hostname -I because it shows you which card each address belongs to and whether the connection is up or down. Use this when you need to troubleshoot which network is working or when you have multiple cards and need to know which address is which.

Understanding the output you see

When you run ip addr show, each network card appears as a numbered block. The first line shows the card name and status — UP means it is active and connected, DOWN means it is not. The lines below show the addresses assigned to that card.

The address 127.0.0.1 always appears under the lo card (loopback). This is your machine talking to itself and cannot reach other computers. Ignore it. Your real network address will be on a different card — usually something like 192.168.1.100 or 10.0.0.50. These are the addresses that let you reach other devices on your home network or the internet.

If a card shows DOWN but you expected it to be connected, the network is not active on that card. Check your WiFi settings or ethernet cable. If a card shows UP but has no inet line, the card is connected but has not received an IP address yet — this usually means your router is not responding or the connection is still initializing.

Using ifconfig if ip addr show is not available

On older Linux systems, ip addr show may not be installed. Type ifconfig instead. This command shows the same information in a different format — network cards listed with their addresses, status, and statistics.

Look for the line labeled inet addr: or just inet followed by your IP address. Again, ignore 127.0.0.1 on the lo interface. Your real address will be on eth0, wlan0, or another named card.

The ifconfig command is being phased out on newer distributions in favor of ip addr show, but it still works on many systems. If neither command exists on your machine, your distribution is unusual — contact your system administrator or check your distribution's documentation for the network configuration tool it uses.

Checking a specific network card

If you know the name of the card you want to check, you can look at just that one. Type ip addr show eth0 (replace eth0 with your card name) to see only that card's information. This is useful when you have many cards and want to focus on one.

You can also use ip link show to see only the card names and status without the IP addresses. This is faster when you just need to know which cards exist and whether they are up or down.

Why your IP address might change

If you check your IP address one day and see a different number the next day, your router is probably using DHCP — a system that assigns addresses automatically instead of permanently. Most home networks use DHCP because it is simpler to set up and manage.

When you restart your computer or reconnect to the network, your router may assign you a different address from its available pool. This is normal and not a problem. If you need the same address every time, you can ask your router to reserve a specific address for your machine, but that is a router setting, not a Linux setting.

Some routers let you set a reservation in their admin panel — usually accessed by typing your router's IP address into a web browser. Look for a section called DHCP reservations, static leases, or address reservation. You will need your machine's MAC address, which you can find in the output of ip addr show — it is the long string of letters and numbers after link/ether.

Viewing IP addresses in a 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 your system tray (usually in the top or bottom corner), then look for a settings or information option. The exact steps vary by desktop — GNOME, KDE, Cinnamon, and others arrange their menus differently.

In GNOME, click the system menu in the top right, then click the network name you are connected to, then click the gear icon for settings. In KDE, right-click the network icon and select connection information. The graphical method is slower than typing a command, but it shows the same information in a more familiar layout.

Frequently Asked Questions

What is the difference between IPv4 and IPv6?

IPv4 addresses have four numbers separated by dots, like 192.168.1.100. IPv6 addresses are longer and use colons and letters, like 2001:db8::1. IPv6 is newer and can support far more devices, but most home networks still use IPv4. Your machine may have both addresses at once.

Why do I see 127.0.0.1 when I check my IP address?

127.0.0.1 is your loopback address — it means your machine talking to itself. It is not your real network address and cannot reach other computers. Look for an address on a different card, usually starting with 192.168 or 10.0.

Can I change my IP address in Linux?

You can set a static IP address instead of using DHCP, but this is usually done through your router or network configuration files, not a straightforward command. For most users, letting DHCP assign your address automatically is simpler and works fine.

What if hostname -I shows nothing?

Your machine may not have an active network connection, or your distribution may not include the hostname command. Try ip addr show instead. If that also shows nothing or only 127.0.0.1, check that your ethernet cable is plugged in or your WiFi is connected.

How do I find my MAC address?

Run ip addr show and look for the line that says link/ether followed by a string of letters and numbers separated by colons. That is your MAC address. Each network card has its own MAC address, so you will see one for each card.