2

How can I find out what a remote Windows PC thinks its host name is, given its IP? From Windows cmd.exe or a Linux shell.

I'm not interested what a DNS server thinks the host name is for an IP, just what the machine which responds to an IP address thinks its name is.

I do not want to use RDP but do have access to an administrative user on the destination PCs.

3 Answers 3

3

This should do:
wmic /node:<your_ip_here> computersystem get name,domain

or if you prefer powershell:
Get-WmiObject -co <your_ip_here> win32_computersystem -property name,domain |format-list -property name,domain

Both will allow you to query a list instead of single PC and specify specific credentials if you need to.

2
nbtstat -a IP-Address

Example: nbtstat -a 192.168.1.1

1
  • I have marked the other answer as 'correct' as I believe that's closer to my intent. However yours is simpler and I've never known a Windows machine to offer a different NetBIOS name to its machine name so this is also a good answer. Commented May 16, 2015 at 5:21
0

You can try using ping with its -a switch to resolve IP addresses to hostnames.

ping -a 192.168.1.1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .