[Samba] Samba AD with multiple DC and multiple NICs

Stefano Vargiu vstefanoxx at gmail.com
Mon Oct 19 11:40:14 UTC 2020

Hello everyone,

I'm trying to add a second DC to a Samba 4 AD: they both have multiple NICs
and for this reason cannot find a way to make it work.
They communicate through VPN and both have one of the bound interfaces set
to the same IP address,, which doesn't allow me to route to the
correct DC, and that is only part of the problem.

Here is the configuration:
* DC1.domain.local
  IP NIC1:
  IP NIC2:

* DC2.domain.local
  IP NIC1:
  IP NIC2:

Before joining DC2 to the AD, I set the entries of DC1 using his VPN IP
both in /etc/hosts: DC1 DC1.domain.local
and in /etc/resolv.conf:
  search domain.local
  domain domain.local

Then I try:
$ kinit administrator

but it hangs and fails, because it tries to contact DC1 through IP, not with the VPN IP I set in /etc/hosts.

I could set up in DC2 a route to the remote IP through VPN, but
what about the second IP which is also used in DC2?
It seems that different operations (kinit and maybe replication after I
join domain) end up querying the DNS without using the entries in
/etc/hosts: how am I supposed to manage a similar situation in Samba?
Should all the IPs of DC1 be reachable from DC2, and vice versa? If so, I'm
forced to change the IP address of NIC2 in DC1 or DC2 to avoid the clash.

I tried to bypass the problem setting the nameserver in DC2 to a local DNS
proxy (dnsmasq) which resolve `DC1.domain.local` and `domain.local` to the
VPN IP of DC1 and forward all other DNS queries to the local Samba (after
the join). And the same I did in DC1.
In this way "kinit" works and the join ends up successfully, but I wonder
if this is the right way to do it.

The command:
$ samba_dnsupdate --verbose

gives me understandably errors of this kind:
Looking for DNS entry A DC2.domain.local as DC2.domain.local.
Lookup of DC2.domain.local. succeeded, but we failed to find a matching DNS
entry for A DC2.domain.local
Lookup of domain.local. succeeded, but we failed to find a matching DNS
entry for A domain.local
Can I ignore them?

Also, now replication works only in one way, from DC1 to DC2. The
replication from DC2 to DC1 gives me the error:
  DsReplicaSync failed - drsException: DsReplicaSync failed WERR_BADFILE

I don't know if it has anything to do with the problems shown above.

Can you suggest to me which is the best way to manage such a situation?

Thank you and kind regards,

More information about the samba mailing list