Sorting list of DC addresses by closest first

Christopher R. Hertel crh at
Wed Apr 21 17:21:50 GMT 2004

On Wed, Apr 21, 2004 at 09:43:22AM -0700, Richard Sharpe wrote:
> On Wed, 21 Apr 2004, Christopher R. Hertel wrote:
> > On Wed, Apr 21, 2004 at 08:25:32AM -0700, Richard Sharpe wrote:
> > >
> > > nmblookup -R -A -S sasafras#1c
> > > 
> > > Yes, is the local NBNS.
> > 
> > Try replacing -A with -U and let me know if that changes anything.
> My mistake, that was -U :-(

Makes more sense that way.  :)
I couldn't figure out what -A was doing there.

So, okay...
What kind of WINS server is running at  Samba or Windows?

One reason that the PDC's IP is supposed to be at the top is that putting
it there guarantees that the PDC is in the list.  MS WINS (supposedly)  
looks for the domain<1B> registration and then tags that IP address as
belonging to the PDC.  If there are any matching domain<1C> registrations
then one of them *should* have the same IP as the PDC's domain<1B>

Here are some MS docs that touch on the subject:
  Read the section titled "How WINS clients locate domain controllers",
  which is near the bottom.
  Search for "Randomize1cList".
  I would love to get more info on how this one works.  I *think* that the
  PDC IP should still be first in the list, but perhaps this parameter
  disables that behavior.  Maybe having the PDC IP first is no longer a
  requirement.  Dunno.  I do note from the description that this parameter
  is 'on' by default.

  Another interesting parameter is "MemberPrecedence".

There's probably a lot more out there.  I *have* seen this on the wire in 
the past, but it was a while ago and I don't have details.

I've just looked through the 3.0 code (outdated, of course, since I was 
caught off guard by the Subversion conversion and I don't have Subversion 
installed) and in my quick glance through I didn't find code to handle 
this special sorting of the IP addresses.

Chris -)-----

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team --     -)-----   Christopher R. Hertel
jCIFS Team --   -)-----   ubiqx development, uninq.
ubiqx Team --     -)-----   crh at
OnLineBook --    -)-----   crh at

More information about the samba-technical mailing list