Short answer

Ask your network for the name. On Windows, type ping -a and the IP address in Command Prompt. On a Mac or Linux PC, type host and the IP address in Terminal. If neither shows a name, your router’s list of connected devices usually does.

In the examples, replace 192.168.1.20 with the IP address you’re looking up.

Look it up on your computer

Windows

Open Command Prompt: press the Windows key, type cmd and press Enter. Then try these one at a time.

  1. Reverse lookup with ping. Type ping -a 192.168.1.20. If Windows finds a name, the first line shows it, for example Pinging LIVINGROOM-PC [192.168.1.20]. Only the IP address in that line means no name was found.
  2. Ask the computer itself. Type nbtstat -A 192.168.1.20 (capital A: a small -a expects a name, not an address). In the table, the name marked <00> and UNIQUE is the computer name. Mostly Windows PCs and some network drives answer.
  3. Ask your DNS server. Type nslookup 192.168.1.20. Many home routers register the names of the devices they give addresses to, such as livingroom-pc.lan. “Non-existent domain” means your DNS server has no name for that address. The router’s device list may still show one.

Mac

Open Terminal and try these.

  1. Reverse lookup. Type host 192.168.1.20. The name is at the end of the answer, for example domain name pointer livingroom-pc.lan.
  2. Devices you talked to recently. Type arp -a. Each line shows an IP address and a hardware (MAC) address. A name comes first when one is known. A ? means no name. Not listed? Ping the address once and run arp -a again.

Linux

Open a terminal and try these.

  1. Reverse lookup. Type host 192.168.1.20 (or nslookup 192.168.1.20).
  2. Windows (NetBIOS) name. Type nmblookup -A 192.168.1.20. On Ubuntu, install it first with sudo apt install samba-common-bin.
  3. The .local name that Macs, Linux PCs and many printers announce: type avahi-resolve -a 192.168.1.20. On Ubuntu, install it with sudo apt install avahi-utils.
  4. Devices you talked to recently. Type arp -a.

Check your router’s device list

Your router hands out the addresses on your network. It keeps a list of which device has which address, usually with its name. This works from any device, phones included.

  1. Open a web browser on a device on your network.
  2. Type your router’s address and press Enter. It’s printed on the router’s label, often 192.168.0.1 or 192.168.1.1.
  3. Sign in with the router’s admin password. It’s not your Wi-Fi password. Some routers print it on the label; others use the one made at setup.
  4. Open the page that lists devices. The name depends on the router: Attached Devices, Connected Devices, Device List, Clients or DHCP Clients.
  5. Find the IP address and read the name next to it.

Set up your router with a phone app? The app shows the same list, under Devices or Clients.

Scan the whole network with nmap

The free nmap tool lists the devices that answer in an address range, on Windows, macOS and Linux:

nmap -sn 192.168.1.0/24

-sn only checks which devices are up, without scanning their ports. Sleeping devices and devices behind a firewall can be missing. For each one, nmap shows the name your DNS server has on record, if there is one. If your addresses start with 192.168.0, use 192.168.0.0/24.

Why no name shows up

Every method needs someone to know the name: the device itself or your router.

What you see Likely reason
No name anywhere The device doesn’t share a name. Many phones, smart TVs and smart plugs don’t.
nslookup or host finds nothing Your router doesn’t register device names in DNS.
nbtstat -A times out A firewall on that computer blocks it, or it isn’t a Windows PC.
A random or generic name in the router list Phones and laptops can use a private Wi-Fi address on each network.

In those cases, the router’s device list is your best bet. It shows whatever name the device gave when it joined.

Questions people ask

Can I find the name of a device that is not on my network?

Usually not. A home’s public IP address is shared by every device behind its router, and the names inside are private. A reverse lookup on a public address shows only the name its owner set. For a home, that’s often the provider’s name for the line.

Does the computer name ever change?

Not until someone renames the computer. The IP address is what usually changes. The router can give a device a new address when it joins again.

How do I find my own computer's name?

On Windows 11, open Settings System About. On a Mac, open System Settings General About. On Linux, type hostname in a terminal.