How to Find Your IP Address in Linux: Commands and Methods Explained
Knowing your IP address in Linux is one of those tasks that sounds simple but has more layers than most people expect. Whether you're troubleshooting a network issue, configuring a server, or just getting oriented on a new machine, the right answer depends on which IP address you're actually looking for — and Linux gives you several ways to find it.
What "IP Address" Actually Means on a Linux System
Before running any command, it helps to understand that your Linux machine may have multiple IP addresses at once. Every network interface gets its own address, and there are two fundamentally different types:
- Private (local) IP address — assigned to your machine within your home, office, or server network. This is what other devices on the same network use to reach you.
- Public (external) IP address — assigned by your Internet Service Provider. This is what the outside world sees when you connect to the internet.
These are not the same number, and commands run locally will return your private IP, not your public one.
There's also the loopback address (127.0.0.1), which is a special internal address every Linux system uses to talk to itself. You'll see it in most outputs — it's not your real network address.
🖥️ Method 1: Using the ip Command (Modern Standard)
The ip command is the current standard tool on most Linux distributions. It replaced the older ifconfig tool and is available by default on Ubuntu, Debian, Fedora, CentOS, Arch, and most others.