During joining a domain with multiple DCs we need to deal with situation that machine account is created using LDAP at one of the DCs and there is a window till the account is replicated to the other DCs. The fix in https://bugzilla.samba.org/show_bug.cgi?id=15905 makes sure that keytab code calls ads_init() with a particular DC (the one which was used for creating the machine account). However there are two more calls during libnet_Join() that might talk to DC and we must make sure that it is the right DC: libnet_join_post_processing_ads_modify() (etype update) libnet_join_post_verify() (domain membership verification) The fix will follow.
Fix in progress: https://gitlab.com/samba-team/samba/-/merge_requests/4435