Tuesday, January 19, 2010

Looking Up Machines with nmblookup





Looking Up
Machines with nmblookup



One of the utilities in the basic Samba
installation is nmblookup, which is a NetBIOS equivalent to nslookup. The
primary purpose of the utility is to resolve NetBIOS names into IP addresses. Typical
usages are as follows:



$ nmblookup KEARNEY
lang=EN-GB>querying KEARNEY on 192.168.0.255
lang=EN-GB>192.168.0.19 KEARNEY<00>
lang=EN-GB> 
$ nmblookup -M -
lang=EN-GB>querying __MSBROWSE__ on 192.168.0.255
lang=EN-GB>192.168.0.11 __MSBROWSE__<01>
lang=EN-GB> 
$ nmblookup -A 192.168.0.19
lang=EN-GB>Looking up status of 192.168.0.19
received 5 names
lang=EN-GB>KEARNEY�������� <00> -�������� M <ACTIVE>
lang=EN-GB>CURTIS��������� <00> - <GROUP> M <ACTIVE>
lang=EN-GB>KEARNEY�������� <03> -�������� M <ACTIVE>
lang=EN-GB>KEARNEY�������� <20> -�������� M <ACTIVE>
lang=EN-GB>CURTIS����� ����<1e> - <GROUP> M <ACTIVE>
lang=EN-GB>num_good_sends=0 num_good_receives=0


The first example looks up the named machine
by doing a subnet broadcast (as can be seen from the .255 address). The
response shows the IP address, NetBIOS name, and resource-type byte for KEARNEY.
If the Windows network has a WINS server, you can specify a direct request with
the
-U <ip-address>lang=EN-GB> option. The second example is a shortcut for looking up the domain
master browser, while the third example performs a status inquiry on an IP
address rather than on a NetBIOS name.



nmblookup has many more modes of operation. As
usual, consult the man page for more information.



 





No comments: