Get Machine Name on Windows

Published 2015-10-07

More often than not, IP address is enough for me to work on things. However, there are times when the system configurations require the machine name/hostname or the security team needs both IP Address and IP Name(or hostname). The funny thing is I always forget the commands. Okay, I usually use nslookup but that is only applicable if the IP is available in the DNS. If not, tough luck. Anyway, here are the commands.

Query IP in the DNS

  1. fire up command console (cmd.exe)
  2. type in nslookup 192.168.1.1
  3. get the name from the output

Query IP without DNS/h3>

  1. fire up command console (cmd.exe)
  2. type in nbtstat -A 192.168.1.1 - the name of UNIQUE entry is the hostname

`

Of course, 192.168.1.1 is the IP address. It goes without saying that you have to change it to the IP address are querying for.`