SUMMARY: Getting the name of a Windows PC from Solaris

Matthew Atkinson (
Fri, 13 Feb 1998 11:02:39 +0000

Dear All,

Thanks to all those who responded to my query about how to find out
the NetBIOS name of a Windows PC from Solaris. They include:-

Jim Harmon <>
Craig Whytock <>
Michael Pavlov <>
Joel Lee <>
"Per Boussard, ERA/T/ED" <>
Karl Vogel <>
Mark Belanger <>
"Mark 'Hex' Hershberger" <>

Answers varied from using nslookup through SMTP to tcp-dump. However,
the correct answer, (and Mark 'Hex' Hershberger was closest here), was
to use the utility nmblookup from the samba suite.

The knack is to use the very latest Samba 1.9.19p2, which has additional
functionality in the nmblookup command.

Use nmblookup -r -A, which will give you a number of
names. The machine name is the first one with <00> in the line. Note
that this command needs to bind to port 137, so you will either need to
be root, or make the script setuid root.

This occasionally does not work, giving the reply No status response,
but most of the time it's fine, and it does the job nicely for me.

Thanks for all who helped.


Matthew Atkinson                      Phone:  +44 (0) 1904 462120
Sun Systems Technical Administrator   Fax:    +44 (0) 1904 462111
Information Systems Team             
Central Science Laboratory            E-mail:
Sand Hutton, York, Yo4 1LZ, England