S4 path for _ldap site aware dc discovery

ronnie sahlberg ronniesahlberg at gmail.com
Tue Nov 27 23:37:54 GMT 2007


Can you have a look at this and review.

It is a patch to S4 plus a new file.

It adds a new DC discovery method  that uses DNS _ldap lookups and CLDAP pings.
It is based on host.c and similar to host.c forks a child process to
query DNS and use CLDAP.
As the other mechanisms already, it only returns the first DC found to
the caller (which is a separate flaw)

It first does a non-site _ldap search for all domain controllers.
It then uses CLDAP to ping them one by one until one of them responds
and provides the site-name for s4.
It then uses a site-aware _ldap search to find all DCs for this site.
Then it CLDAP pings all DCs for the current site and verifies which
ones are available.
It does create a list of all available DCs for the current site, but
only the first one is returned to the caller.

To activate the code you need to add
dns domain name = foo.bar.com
dc name resolve order = _ldap ...

If dc name resolve order is not set in smb.conf name resolution will
fall back to name resolve order  which does not contain _ldap.

If these two new parameters are not set, the code will not be invoked.

It is suboptimal to need  "dns domain name"  and this also means it
wont work for locating a DC in a remote domain using the _ldap method.
A netbiosname -> dnsname mapping might be a useful extension.

Once applied, S4 wont build since LIBCLI_RESOLVE now needs and depends
on LIBCLI_CLDAP and this causes a circular dependency between these
two libraries.

regards ronnie s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnssrv.diff
Type: text/x-patch
Size: 5017 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20071128/911e06ba/dnssrv.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnssrv.c
Type: text/x-csrc
Size: 13159 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20071128/911e06ba/dnssrv-0001.bin

More information about the samba-technical mailing list