What a hostname is and why you need it

A hostname is the name your device uses to identify itself on your network — like "James-Laptop" or "Kitchen-Printer". An IP address is the numerical location where that device lives, like 192.168.1.105. When you know only the IP address, finding the hostname tells you which physical device it actually is, which matters when you're troubleshooting a slow connection, checking who's on your network, or setting up port forwarding rules.

Most home networks assign IP addresses automatically through DHCP, so devices get new numbers when they restart. The hostname stays the same. If you see an unfamiliar IP address on your network and want to know what device it belongs to, the hostname is your answer.

Key Takeaways

  • Your router's admin page shows all connected devices with both their IP addresses and hostnames in one list.
  • On Windows, the command nslookup or ping can reverse-look up a hostname from an IP address if the device responds.
  • On Mac and Linux, dig or host commands do the same reverse lookup from the terminal.
  • If a device doesn't respond to ping or your router doesn't show the hostname, the device may be offline or not broadcasting its name.

Check your router's connected devices list

The fastest way is to log into your router and look at the list of connected devices. Open a web browser and type your router's IP address — usually 192.168.1.1 or 192.168.0.1 — then log in with your admin username and password. Look for a section called "Connected Devices", "DHCP Clients", "Device List", or "Attached Devices".

This page shows every device currently on your network with its IP address, hostname, MAC address, and sometimes the device type. Find the IP address you're looking for and read the hostname next to it. This method works even if the device isn't responding to network commands, because the router tracks it automatically.

If you don't know your router's IP address or login, check the sticker on the back of the router or your router's manual. If you've changed the admin password and forgotten it, you'll need to factory reset the router, which erases your settings.

Use nslookup on Windows

Open Command Prompt (search for "cmd" in the Windows Start menu) and type nslookup 192.168.1.105, replacing the IP address with the one you're looking for. Press Enter.

If the device is online and has a hostname registered on your network, the result will show a "Name:" field with the hostname. If you see "Non-existent domain" or no name appears, the device either isn't responding, isn't on the network, or hasn't registered its hostname with your DNS server.

An alternative is ping -a 192.168.1.105, which attempts to resolve the hostname while checking if the device responds. This works on some networks but not all, depending on how your router handles DNS lookups.

Use dig or host on Mac and Linux

Open Terminal and type dig -x 192.168.1.105 or host 192.168.1.105, replacing the IP address with the one you need. Press Enter.

The dig command shows detailed DNS information, including the hostname in the "ANSWER SECTION" if one exists. The host command is simpler and returns just the hostname on one line. Both commands work the same way: they ask your network's DNS server to reverse-look up the IP address and return the name.

If neither command returns a hostname, try ping 192.168.1.105 to see if the device responds at all. Some devices don't register hostnames with DNS even when they're online.

When reverse lookup doesn't work

If nslookup, dig, or host return no result, the device may not be broadcasting its hostname, or it may be offline. Some devices — particularly older printers, smart home gadgets, or phones on guest networks — don't register with your DNS server even when connected.

In this case, go back to your router's device list. The router knows about every device on the network whether or not it responds to DNS queries. If the IP address doesn't appear in the router's list at all, the device is either offline or not connected to your network.

If the device is in the router's list but has no hostname shown, you can usually rename it directly in the router's settings. Look for an "Edit" or "Rename" option next to the device entry.

Assign a permanent hostname to a device

If a device doesn't have a hostname or you want to change it, you can set one in your router. Log into the router, find the device in the connected devices list, and look for an edit or rename button. Type a clear name like "Living-Room-Camera" or "Guest-Printer" and save.

Some devices also let you set their hostname directly. On Windows, right-click "This PC" or "My Computer", select "Properties", and look for "Computer name" or "Device name". On Mac, go to System Preferences > Sharing and change the "Computer Name". On Linux, edit the hostname file or use the hostnamectl command.

After you change a hostname on the device itself, restart it so the network picks up the change. The router may take a few minutes to update its device list.

Frequently Asked Questions

Why does my router show an IP address but no hostname?

The device is connected but hasn't registered a hostname with your DNS server, or your router doesn't display hostnames for that device type. Check the device's own settings to see if it has a name assigned, or rename it in your router's admin page.

Can I find a hostname for an IP address on someone else's network?

No. Reverse DNS lookups only work on networks you're connected to. From outside the network, you can't see hostnames without special access. This is a security feature — it prevents strangers from mapping your home network.

What if the IP address I'm looking for isn't in my router's device list?

The device is offline or not connected to your network. Check that it's powered on and connected to the correct Wi-Fi network. If it's a wired device, verify the ethernet cable is plugged in. Wait a minute and refresh the router's device list.

Does every device on my network have a hostname?

Not necessarily. Every device has an IP address, but not all devices broadcast or register a hostname. Smart home devices, older printers, and phones on guest networks often don't have hostnames even when they're online and working normally.