[jcifs] querying a wins server for a list of workgroups

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Fri Jul 27 08:54:11 EST 2001

> -----Original Message-----
> From:	Christopher R. Hertel [SMTP:crh at ubiqx.mn.org]
> > a query for the <workgroup>0x1c name is sent to the WINS server which
> > then returns the IP address of the master browser for that workgroup
> > which might very well be on a different subnet.
> Nope.  0x1C names are very, very wierd.
> Domain Controllers register these names.  They are *group* names, not

> The 0x1C name can be used to find PDCs or BDCs for authentication
> purposes.
> The PDC also registers the <ntdomain>0x1B name, which does dual duty.  
> The 0x1B name is a unique name, not a group name.  It identifies that
> particular DC as the PDC, and it also identifies that node as a DMB.
	Ahh, yes, maybe it was 0x1B that I saw.


> > should be pretty strait forward to add this 0x1c WINS lookup. You would
> > then be able to resolve master browsers on different subnets and viola
> > you will be able to enumerate every host on the *entire* network.
> You *cannot* use WINS to find Local Master Browsers on remote subnets.  
> WINS doesn't store 0x1D names, and it only stores the
> address for the __MSBROWSE__ name.
	Well what about a 0x1B lookup to WINS?

> > the SMB URL behavior. If smb://workgroup is a workgroup on another subnet
> > where broadcasts do not reach what's the protocol?
> That's a good question.  The answer, though, is that the
> <remote_workgroup>0x00 group name would be registered with the WINS
> server.  Thus, the name exists within the namespace.
> Adding a feature to jCIFS to allow it to query DMBs in addition to LMBs
> doesn't break that, it just gives jCIFS the advantage of being able to
> access browse lists in a more direct way.  Windows systems have to wait
> until their LMBs sync with their DMBs.
> In some cases, the Windows system will never see browse lists outside
> their subnet.  This happens when their subnet contains only workgroups and
> no ntdomains, thus no sync with a DMB.  Again, jCIFS has an advantage if
> it can find the 0x1B name of a "foreign" ntdomain and query the DMB
> directly.
> One more interesting thought...  If you know the IP address of a remote
> LMB (imagine a remote workgroup--no DMB), you should be able to ask it for
> its browse list.  There is currently no mechanism in the SMB URL to do
> this.  The draft could, however, be changed to allow:
>   http://<dns_or_ip>/
> to go through the same semantic 'is it a server or a workgroup' hoops that
>   http://<nbt_name>/
> goes through.
	Actually jCIFS doesn't quite do this. If the netbios name in an NbtAddress
	object is not defined, attempting to retrieve the name for it will trap and result
	in a reverse lookup (i.e. Node Status Request) on the IP (which must be
	defined or the NbtAddress object could not have been created in the first place).
	All of these names are cached but this doesn't change the code that tries to
	determine wheather or not the name is a workgroup/domain/name. At no point
	would jCIFS try to connect by IP and retrieve a browse list. Trying to reiterates
	the same old problem of deciding what name to use for session establishment.


More information about the jcifs mailing list