Using Samba: A File and Print Server for Linux, Unix & Mac OS X, 3rd Edition
| nmblookup |
The nmblookup program is a client program that allows command-line access to NetBIOS name service for resolving NetBIOS computer names into IP addresses. The program works by broadcasting its queries on the local subnet until a machine with the specified name responds. You can think of it as a Windows analog of nslookup or dig . This is useful for looking up regular computer names, as well as special-purpose names, such as _ _MSBROWSE_ _ . If you wish to query for a particular type of NetBIOS name, add the NetBIOS type to the end of the name, using the format netbios_name #< dd > .
Command synopsis
nmblookup [options] netbios_name
Options
- -A
-
Interprets netbios_name as an IP address and does a node status query on it.
- -B broadcast_address
-
Sends the query to the given broadcast address. The default is to send the query to the broadcast address of the primary network interface.
- -d debug_level
-
Sets the debug (sometimes called logging) level. The level can range from 0 to 10. Debug level 0 logs only the most important messages. Level 1 is normal; levels 3 and above are primarily used by developers for debugging the nmblookup program itself and slow the program considerably.
- -f
-
Prints the flags in the packet headers.
- -h
-
Prints command-line usage information for the program.
- -i scope
-
Sets a NetBIOS scope identifier. NetBIOS scope is a rarely used precursor to workgroups.
- -M
-
Searches for a local master browser by looking up netbios_name <1d> . If netbios_name is specified as a dash ( - ), a lookup is done on the special name _ _MSBROWSE_ _ .
- -R
-
Sets the "recursion desired" bit in the packet. This causes the system that responds to try a WINS lookup and return the address and any other information the WINS server has saved.
- -r
-
Uses the root port of 137. This option exists as a bug workaround for Windows 95. This option might require the user to be superuser.
- -S
-
Performs a node status query once the name query has returned an IP address. This returns all the resource types that the system knows about, including their numeric attributes. For example:
$ nmblookup -S toltec querying toltec on 172.16.1.255 172.16.1.1 toltec<00> Looking up status of 172.16.1.1 TOLTEC <00> - M <ACTIVE> TOLTEC <03> - M <ACTIVE> TOLTEC <20> - M <ACTIVE> ..__MSBROWSE__. <01> - <GROUP> M <ACTIVE> METRAN <00> - <GROUP> M <ACTIVE> METRAN <1b> - M <ACTIVE> METRAN <1c> - <GROUP> M <ACTIVE> METRAN <1d> - M <ACTIVE> METRAN <1e> - <GROUP> M <ACTIVE>
- -s configuration_ file
-
Specifies the location of the Samba configuration file. Although the file defaults to /usr/local/samba/lib/smb.conf , you can override it here on the command line. Normally used for debugging.
- -T
-
Translates IP addresses into resolved names.
- -U unicast_address
-
Performs a unicast query to the specified address. Used with -R to query WINS servers.
Note that nmblookup has no option for setting the workgroup. You can get around this by putting workgroup = workgroup_name in a file and passing it to nmblookup with the -s option.