i'm having a problem using ldap based on Active Directory in a multi-site environment.
Basically I have several different environments(sites) and each of them have its own dedicated couple of domain controller servers. Each couple of domain controllers talks to the couples in other sites in order to keep all informations synchronized.
In each environment I have also several different linux servers(webservers,applications servers etc.) and, for authentication and authorization purposes, they have to contact the correct domain controllers which are dedicated to their environment.
My problem is that i can't find a way to specify into the configuration of those servers how to contact their "nearest" domain controller.
Until now i used the DNS A record domain.local
which returns EVERY domain controller into the domain; the problem is that it returns also domain controllers not in the correct site and so unreachable.
The another way i thought is to create an CNAME record for each site which refer to the correct DCs.
DC-Site1 CNAME to DC1 and DC2 DC-Site2 CNAME to DC3 and DC4 DC-Site3 CNAME to DC5 and DC6 ....
So using the record DC-SiteX.domain.local
i'm able to contact the correct couple of domain controllers in the site.
The problem of this solution is that i have to hardly code into the configuration server which site it belongs. I don't like because i may move the servers to different site and i have to remember to update this configuration.
Usually how do you handle this situation?
Do you have an elegant solution for this problem?