Retrieving browser lists

William R. Knox wknox at
Tue Jun 27 12:25:45 GMT 2000

A two step process which will get you what you want. Do the following:

1. Query your localhost for shares (smbclient -N -L \\hostname). This
will list the shares you have, your machines browse list, and then the
workgroup list. In the workgroup list, it will have the local master
browser for each workgroup, including your own. (if you are the local
master browser, you can get the full browse list locally, albeit in a
different format - the default location is, I believe,
/usr/local/samba/var/locks/browse.dat. This file should always exist
with the machines own browse list and could also be used to obtain the
information about who is the local master browser).

2. Query the local master browser as above. This will spit back the same
sort of list (the -N flag, by the way, prevents it from asking for a
password, which will assist in automation), which will then contain in
the second part the browse list for the subnet.

Good luck!

Omer Shenker wrote:
> I've searched the Samba docs, man pages, Using Samba, and a few other
> places. I've been unable to find a way to retrieve the browse list (as in
> Network Neighborhood or net view on Win32) from Samba. I'm using a RH 6.2
> box running Samba 2.0.7 in a multi-subnet workgroup (which is really a
> domain, but I don't have a machine trust account and I'm using security =
> server). Samba is not involved in providing browsing or WINS, though it
> utilizes both. I don't care if the format I get it in is messy like that of
> nmblookup, because I'm parsing it in Perl anyway.
> I'd greatly appreciate any enlightenment on this.
> --
> Omer Shenker                     oshenker at

			Bill Knox
			Senior Operating Systems Programmer/Analyst
			The MITRE Corporation

More information about the samba mailing list