There is no single built-in Linux command that lists every device on a network; the closest standard tools are ip neigh (or the older arp -a) for devices your machine has recently talked to, and nmap -sn for an active sweep of a whole subnet. The detail most people get wrong is that ip neigh only shows hosts in the kernel's neighbour cache, so a device that has been quiet for a few minutes may not appear at all.

That distinction decides which command you actually want. If you need a quick look at what your machine already knows about, the neighbour table is instant and needs no extra software. If you need a genuine inventory of the subnet, you have to send traffic and wait for replies, which is what nmap or arp-scan do.

Reading the neighbour table with ip neigh and arp

The neighbour table maps IP addresses to link-layer (MAC) addresses for hosts on the same local network segment. On any current Linux distribution the command is:

ip neigh show

Each line gives the IP, the interface it was seen on, the MAC address and a state such as REACHABLE, STALE or DELAYED. REACHABLE means the entry was confirmed recently; STALE means it is still considered valid but has not been verified lately. Both are useful, but a STALE entry can point to a device that has since left the network.

The older equivalent, still present on many systems, is arp -a, which prints the same table in a different format. If arp is missing, it usually lives in the net-tools package, which many distributions no longer install by default. Prefer ip neigh; it ships with the iproute2 package that is part of a base install.

To watch the table change as devices appear, add a monitor mode:

ip neigh show nud all lists entries in every state, including FAILED and INCOMPLETE, which the plain command hides. This is the version to use when you suspect a device is present but not answering.

Why the neighbour table is not a full device list

The kernel only keeps an entry for an IP it has recently tried to reach, or one that has recently reached it. Entries age out. A printer that has been idle for a while, a phone that is asleep, or a smart plug that only checks in occasionally can all be absent from ip neigh even though they are connected.

There are two more gaps worth knowing. First, the table only covers the local subnet; devices behind a router on another subnet appear only as the router's own address. Second, a host that never responds to ARP requests, or that sits behind a bridge or a wireless isolation setting, may never show up at all.

If you need the full picture, you must actively probe. That is the next step, and it needs a tool that is not part of a base Linux install.

Active discovery with nmap and arp-scan

The standard way to sweep a subnet is a ping scan, which sends probe packets to every address in a range and records who answers:

nmap -sn 192.168.1.0/24

Replace the address and prefix with your own subnet. -sn means "no port scan": it only checks whether each host is up, which is faster and less intrusive than a full scan. A /24 covers 256 addresses, which is the usual size of a home network; a larger prefix such as /16 covers far more and takes proportionally longer.

arp-scan is a lighter alternative that works purely at layer 2 and is often faster on a local segment:

sudo arp-scan --localnet

It prints IP, MAC and the hardware vendor derived from the MAC's organisationally unique prefix. That vendor column is often the most useful part, because it tells you what kind of device you are looking at even when the hostname is unhelpful. Neither tool is installed by default on most distributions, so install them from your package manager first; the package names are nmap and arp-scan.

Both need elevated privileges for raw packet access, which is why sudo appears in front of the commands. Run them only on networks you own or administer.

Turning addresses into names and identifying what you found

An IP and a MAC address rarely tell you which device is which. Three follow-ups close most of the gap.

First, reverse DNS: dig -x 192.168.1.10 or nslookup 192.168.1.10 asks the local resolver for a hostname. On home routers this often returns a friendly name such as a laptop or phone label, but it frequently returns nothing.

Second, mDNS, which many devices on a home network use to advertise themselves. avahi-browse -art lists advertised services and their hostnames if the Avahi tools are installed. This catches printers, media players and some smart-home gear that reverse DNS misses.

Third, the router itself. Its administration page almost always has a client list with names, and that list is authoritative because the router sees every device that associates. Consult the router's own interface when the command-line tools leave you guessing; menu labels differ by model and firmware, so look for a section named something like Attached Devices, Client List or DHCP Clients.

ToolWhat it showsNeeds installBest for
ip neighRecently seen local hostsNoInstant check
arp -aSame table, older formatSometimesLegacy scripts
nmap -snEvery host that answersYesFull subnet sweep
arp-scanIP, MAC, vendorYesFast local scan

What to do when a device still does not appear

If a sweep returns fewer devices than you expect, check these in order. Confirm you are scanning the right subnet: ip addr shows your own address and prefix, and the network portion is what you should sweep. A machine on 192.168.0.0/24 will find nothing on 192.168.1.0/24.

Check whether the device is on a separate band or VLAN. Many routers put guest networks and IoT devices on an isolated segment, and a scan from the main network will not cross that boundary. Wireless client isolation does the same thing on a single access point.

Check whether the device is simply asleep. Phones and laptops drop off Wi-Fi when idle, and a ping scan may miss them until they wake. Run the scan twice, a minute or two apart, and compare.

Finally, some devices block ICMP, which is what nmap -sn relies on by default. Adding -Pn treats every host as up and probes ports instead, which finds hosts that ignore pings but still answer on a service port. That is slower, but it closes the most common false-negative.

The practical routine is therefore: run ip neigh show for an instant look, run nmap -sn on your subnet for a real sweep, resolve names with reverse DNS and mDNS, and fall back to the router's client list when a device refuses to identify itself.