How to find your IP address on Linux
On Linux, you can find your IP address using the command line in under a minute. The most straightforward method is to open a terminal and type ip addr show or hostname -I. Both commands display your IP address when ready — you do not need administrator access for either one.
Your IP address appears as a string of four numbers separated by periods, like 192.168.1.50. On a home network, it usually starts with 192.168 or 10.0. The command shows all network connections on your device, so if you have multiple network adapters (like both WiFi and Ethernet), you will see an address for each one.
The method you choose depends on what information you need. If you only want your IP address and nothing else, hostname -I is fastest. If you want to see which network connection is active and get additional details like your gateway or DNS servers, ip addr show gives you more context.
Key Takeaways
- Type ip addr show in a terminal to see your IP address along with details about each network connection on your device.
- Type hostname -I for just your IP address with no extra information.
- Your home network IP address typically starts with 192.168 or 10.0 and consists of four numbers separated by periods.
- If you have both WiFi and Ethernet connected, you will see a separate IP address for each connection.
- You do not need to be logged in as root or use sudo to view your own IP address.
Using the ip command to see all network details
The ip addr show command is the standard way to view network information on modern Linux systems. Open a terminal, type the command, and press Enter. The output shows every network interface on your device, including loopback (which is your computer talking to itself) and any active connections.
Look for the line that starts with inet — that is your IPv4 address, which is the format used on home networks. It appears after the word "inet" and before a forward slash. For example, you might see "inet 192.168.1.50/24" — the number before the slash is your IP address.
If you see multiple inet lines, each one belongs to a different network interface. The interface name appears at the start of each block — common names are eth0 (Ethernet), wlan0 (WiFi), or lo (loopback). Your active connection is the one with an inet address that does not start with 127.
Using hostname to get just your IP address
If you only need your IP address and want the fastest output, type hostname -I and press Enter. This command returns just the address or addresses, with no extra text or formatting. If you have one network connection active, you get one IP address. If you have two connections, you get both addresses separated by a space.
This method works on nearly all Linux distributions and is useful when you need to copy your IP address quickly or use it in a script. The output is plain and straightforward to read, with no labels or additional information to parse through.
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 menu. The exact location depends on which desktop you are using — GNOME, KDE, XFCE, and others all organize this differently.
On GNOME (used by Ubuntu and Fedora), click the network icon in the top right corner, then click the settings icon or "Settings" option. Look for your active connection and click it — your IP address appears under "IPv4 Address" or "IP Address". On KDE Plasma, open System Settings, go to Network, and select your connection to see the address.
The graphical method takes longer than typing a command, but it shows your address in a clear, labeled format. Use this approach if you are not comfortable with the terminal or if you need to see your address alongside other network settings like your gateway or DNS servers.
Understanding what the numbers mean
Your IP address on a home network consists of four groups of numbers, each between 0 and 255, separated by periods. The first three groups identify your network, and the last group identifies your specific device. For example, in 192.168.1.50, the "192.168.1" part is your network, and "50" is your device.
The number after the slash in commands like ip addr show (such as /24 in 192.168.1.50/24) is the subnet mask in a shortened form. It tells your device how many of those four groups belong to the network and how many identify individual devices. You do not need to understand this number to use your IP address — it is there for reference.
If your IP address starts with 127, that is your loopback address — it means your computer is talking to itself, not to your network. If it starts with 192.168 or 10.0, that is your real network address and the one you need for connecting to other devices on your home network.
What to do if you do not see an IP address
If you run ip addr show or hostname -I and see no address, or only see 127.0.0.1, your network connection is not active. Check that your WiFi is turned on or that your Ethernet cable is plugged in. Then run the command again.
If your connection is on but you still see no address, your device may not have received an address from your router yet. Wait 10 to 15 seconds and try again. If the problem persists, restart your network connection by turning WiFi off and back on, or by unplugging and replugging your Ethernet cable.
On some systems, you may need to restart the network service. Open a terminal and type sudo systemctl restart networking, then press Enter. You will be asked for your password. After the service restarts, run ip addr show again to see if your address appears.
Using ifconfig on older Linux systems
On older Linux distributions, the ifconfig command was the standard way to view network information. It still works on many systems, though ip addr show is now preferred. If you type ip addr show and get a "command not found" error, try ifconfig instead.
The output format is different from the ip command, but the information is the same. Look for the line that starts with "inet addr:" — the number after that is your IP address. Like ip addr show, you will see one block of information for each network interface, and you can ignore any interface named "lo" (loopback).
If ifconfig is also not found, you may need to install the net-tools package. On Ubuntu or Debian, type sudo apt install net-tools. On Fedora or Red Hat, type sudo dnf install net-tools. After installation, ifconfig will work.
Frequently Asked Questions
Why do I see multiple IP addresses when I run the command?
Each network interface on your device gets its own IP address. If you have WiFi and Ethernet both connected, you will see two addresses — one for each connection. You can use either address to connect to your device from another computer on the network. If you only want to use one connection, disconnect the other one.
Is my IP address the same as my MAC address?
No. Your IP address is four numbers separated by periods (like 192.168.1.50) and changes when you restart or reconnect to the network. Your MAC address is six pairs of letters and numbers separated by colons (like aa:bb:cc:dd:ee:ff) and stays the same. The ip addr show command displays both — your MAC address appears on the same line as your interface name, labeled as "link/ether".
Can I change my IP address on Linux?
Yes, but most home users do not need to. Your router assigns your IP address automatically, and it usually stays the same unless you restart your device or go offline for a long time. If you need a specific address, you can set a static IP in your network settings or through your router's admin panel. For most purposes, letting your router assign an address automatically is simpler and works fine.
What if my IP address starts with 169.169?
An address starting with 169.169 means your device did not receive an address from your router. This usually happens when your WiFi or Ethernet is not properly connected. Check that your connection is active, wait a few seconds, and try again. If the problem continues, restart your network connection or restart your device.
Do I need to be root to see my IP address?
No. Both ip addr show and hostname -I work for any user without needing sudo or root access. You only need elevated permissions if you want to change your IP address or modify network settings, not to view them.