[Samba] Samba as W2k3 AD domain member; how to configure domain controller failover?

Alex de Vaal a.vaal at nh-hotels.com
Mon Dec 13 16:58:33 GMT 2004

Dear list,

I have a question how you configure Samba (configured as a W2k3 domain
member) to failover to a secondary AD domain controller when the connection
to the primary domain controller fails.

First some info:

- Windows 2003 Active directory (native mode), currently running with 2
domain controllers.
- Samba (version 3.0.9) running on a RHL9 server (updated with kerberos
   samba is compiled against kerberos 1.3.1-7 and configured as AD domain
   The winbind daemon is used for AD user validation.
- IP addresses W2k3 domain controllers: (adm01= domain
master) and (adm02)
- IP address RHL9 server:
- DNS is properly configured on RHL9 server and W2k3 servers.

My smb.conf file looks like this:
workgroup = TEST
realm = TEST.COM
security = ADS
password server =,
domain master = No
dns proxy = No
idmap uid = 10000-20000
idmap gid = 10000-20000
template homedir = /data/hom/%U
template shell = /bin/bash 

	comment = Group Directory
	path = /data/grp
	valid users = @TEST.COM\DEP_TEST_MEMBER
	read only = No
	inherit permissions = Yes

resolv.conf looks like this:
search test.com
domain test.com 

nsswitch.conf looks like this:
passwd:     files winbind
shadow:     files
group:      files winbind
hosts:      files dns wins

"wbinfo -g" and "getent group" give the appropriate output. Via the chown
command I was able to give the AD group DEP_TEST_MEMBER access to the
/data/grp directory on the linux server (chmod 770 and chown "root:TEST\
XP clients can connect to the [grp] share on the samba server when they are
member of the AD group DEP_TEST_MEMBER and can store files on the share. So
far so good.

If I look with "netstat -na" I can see that the Samba server is connected to
the primary domain controller:
tcp        0      0
tcp        0      0

When the connection with the primary domain controller ( is
suddenly lost, then samba will NOT failover to the second domain controller
( It is just trying to connect to the first configured one
all the time. "net ads info" will do a request at the second DC (after a
timeout of 15 sec, which I can configure to 2 seconds with "ldap timeout
"wbinfo -u" will give after a short while the error message: "Error looking
up domain users" and I have difficulty to connect to the Linux server with
Telnet (it tries the user that logonwith Telnet, even the root user,  to
validate against the AD). The XP clients will loose the connection to the
[grp] share after a short while. This will become a "status quo", nothing

The only thing I can do is manually failover to get Samba working properly
again. I changed the global option "password server" to "password server =,", rebooted the Linux server and now the
Samba server connected to the second DC:
netstat -na
tcp        0      0
tcp        0      0

"wbinfo -g" and "getent group" give the appropriate output and the XP client
can connect to the [grp] share again.

How can I configure Samba to failover to the second DC, so even XP clients
with connection to Samba shares won't even notice it when the connection to
the primary DC gets lost? I googled for  h o u r s  for this answer and I
found that someone used "net ads join -S" option and used the "join" option
on all DC's in the AD. (look at
http://lists.samba.org/archive/samba/2004-October/093721.html). I tried that
too, but it didn't help.

This problem is bugging me for quite a while now (also in my real
environment), so it became a very important question for me (but the
solution is more important ;-), therefore any help is very much appreciated!


More information about the samba mailing list