When you need to find your own machine’s network details, the linux command to check ip address is the first thing to learn. Whether you are setting up a home server, troubleshooting a connection that has suddenly stopped working, or simply confirming which network your laptop has joined, Linux gives you several clear, built-in ways to see the answer. This guide explains the most useful commands, what each part of their output means, and how to use them safely on your own computer only.
That last point matters. Every command here inspects your own machine and your own local network connection. A linux command to check ip address shows the addresses assigned to your own interfaces, not anybody else’s, and it should never be used to probe machines you do not own or administer. With that boundary clear, the commands themselves are straightforward, and learning them will save you a great deal of guessing whenever a network problem appears.
Linux Command to Check IP Address: The Basics
The modern standard is the ip command. Typing ip addr show in a terminal lists every network interface on your own machine, together with the addresses assigned to each. You will usually see a loopback interface, used for internal communication within the machine itself, and one or more real interfaces for wired or wireless connections. Beside each interface name you will find its addresses, its state (up or down), and its maximum packet size. The linux command to check ip address in this form is precise, uncluttered, and available on virtually every current distribution.
For a shorter view, ip -brief addr condenses the same information to one line per interface, which is ideal when you only need a quick answer. If you want colour and emphasis on the address itself, ip -brief -color addr highlights the important fields. Learning this one linux command to check ip address will cover most everyday needs, and it is the command to reach for first before trying anything more specialised.
Reading the Output of IP Addr
Output can look intimidating at first, but only a few fields matter for most users. The interface name, such as the wired or wireless name, tells you which connection you are looking at. The address after inet is the version four address for that interface, and the number after the slash is the subnet size, which describes how large the local network is. The address after inet6 is the version six equivalent. Ignore the loopback entries for ordinary troubleshooting: they describe the machine talking to itself, not your connection to a router or the internet. Understanding the vocabulary helps, and our guide on another name for a network explains the underlying terms in plain language.
Other Linux Commands to Check IP Address
Several alternatives exist, and each suits a slightly different situation. The command hostname -I prints just the addresses assigned to your own machine, with no interface detail, which is perfect for copying an address into a configuration file. The command hostname -i is similar but may behave differently depending on how your system resolves its own name, so prefer the capital-I form when you want the actual assigned addresses. As a linux command to check ip address shortcut, hostname -I is hard to beat for speed.
On systems using NetworkManager, nmcli device show displays detailed information about each connection, including addresses, gateways, and DNS servers, while nmcli -p device show formats it more readably. For a graphical user who occasionally opens a terminal, this command bridges the gap between the settings app and the command line. Another useful linux command to check ip address approach is ip route get 1.1.1.1, which shows which local address your machine would use to reach the outside world, and which gateway it would use — valuable when a machine has several connections and you need to know which one is actually in use.
Older Tools: Ifconfig and Friends
Older tutorials mention ifconfig, and you may still find it installed on some systems. It shows similar information to ip addr, but it is no longer maintained on most distributions and may be absent from a fresh install. If you meet it in an old guide, translate it mentally to the modern linux command to check ip address: ifconfig becomes ip addr show, and ifconfig interface becomes ip addr show interface. New scripts and new documentation should use ip, because it handles modern features, such as multiple addresses per interface, far more cleanly.
Similarly, netstat -rn has largely been replaced by ip route for viewing the routing table. The routing table answers a different question from the address list: not “what addresses do I have?” but “where does my traffic go next?” For troubleshooting, both answers help. A machine can hold a correct address yet fail to reach anything if its gateway is wrong, and a linux command to check ip address session that also checks ip route will catch that case quickly.
Public Addresses, Private Addresses, and Your Own Machine
A common source of confusion is the difference between the private address your router gives your machine and the public address the internet sees. Commands run on your own machine show the private address by default, because that is the address your machine actually holds. Your router performs address translation for outgoing traffic, so the wider internet sees the router’s public address instead. A linux command to check ip address therefore answers the local question, and that is usually the question you need answered when configuring a local service, a printer, or a file share.
If you genuinely need to know the public address of your own connection — for example, when allowing your own home connection through a firewall you administer — use a method that queries a service from your own machine, and remember that the result belongs to your connection at that moment. Addresses can change when a router restarts or a provider reassigns them, so never hard-code a public address into a long-lived configuration without a plan for updating it. Treat any address you discover as information about your own setup, to be used for your own administration, and nothing more. For context on keeping your own connection private, see our explainer on what a VPN means.
| Command | What it shows | Best for |
|---|---|---|
ip addr show |
All interfaces and addresses on your own machine | General troubleshooting |
ip -brief addr |
One-line summary per interface | Quick checks |
hostname -I |
Assigned addresses only | Copying an address quickly |
nmcli device show |
Connection details including gateway and DNS | NetworkManager systems |
ip route |
Routing table and default gateway | Diagnosing “connected but no internet” |
ip route get 1.1.1.1 |
Which local address and gateway would be used | Machines with several connections |
Troubleshooting With the Linux Command to Check IP Address
Suppose your machine claims to be connected but nothing loads. Start with the linux command to check ip address in its brief form. If no interface shows an address, the connection itself has failed: check the cable, the wireless network name, and whether the interface is enabled. If an address is present but pages do not load, check ip route for a default gateway, and then check DNS by trying a known name. Each step narrows the problem, and writing down what each command showed makes it far easier to ask for help, because you can describe facts rather than symptoms.
Another useful habit is comparing a working state with a broken one. When everything works, run ip -brief addr and ip route once and keep the output in a note. The next time something fails, run the same linux command to check ip address pair and compare. Differences — a missing interface, a changed gateway, an unexpected address range — point directly at what changed. This methodical approach beats repeatedly restarting services and hoping, and it builds genuine understanding of your own network over time.
Linux Command to Check IP Address: Frequently Asked Questions
What is the quickest Linux command to check IP address?
For most users, hostname -I gives the fastest answer, because it prints only the addresses. If you also need to know which interface holds each address, use ip -brief addr instead. Either way, you are using a linux command to check ip address that inspects only your own machine.
Should I still learn ifconfig?
It is useful to recognise ifconfig when reading older guides, but new work should use ip. The modern tool is maintained, more expressive, and installed by default on current distributions, so it is the safer skill to invest in.
Why does my machine show several addresses?
Most machines have more than one interface, and each can hold several addresses, including version four and version six forms. The loopback interface always appears, wired and wireless interfaces appear when present, and virtual interfaces appear when you run containers or virtual machines. Focus on the interface for the connection you are actually using.
Conclusion
The linux command to check ip address is a small skill with an outsized payoff. Start with ip addr show for full detail, keep ip -brief addr and hostname -I ready for quick checks, and add ip route whenever connectivity itself is in doubt. Use these commands on your own machines, keep a note of a healthy output for comparison, and work through problems step by step rather than guessing. Within a short time, checking your own network details will feel as routine as checking the time, and you will be able to describe any problem precisely — which is, in the end, most of what troubleshooting actually requires.



