Code scraps: Find a local Windows Machine Name from IP Address (on Windows)

Here’s a quick code scrap to return the Machine Name for a Windows system on a local network using the Windows Command Line.

nbtstat -a <ip address>

This will return output from the Windows NetBIOS record for the machine and should produce a printed table. There can sometimes be a few different values returned, but the entry with “20” in the name should be the name of the machine in question.

The above is only likely to work if you’re on the same local Intranet of the target machine. If you’re trying to do Reverse Lookup for Global IP addresses or non-Windows machines on the local network, you need to look at using nslookup <ip address>.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.