I'm in a quandary.
I need to implement Split-Horizon DNS in my office based on subnet. For example:
- Users in 10.170.0.0/16 need to resolve "srv01.extra.company.com" to
10.170.0.510.25.0.170 - Users in 10.180.0.0/16 need to resolve "srv01.extra.company.com" to
10.180.0.510.25.0.180 - Others in 10.0.0.0/8 need to resolve "srv01.extra.company.com" to 10.25.0.5
Now, this is easy to implement using BIND. Unfortunately, my network is based on Active Directory; I can't possibly change the DNS Servers of all workstation to just point to the BIND server, can I? They need to be pointing to Domain Controllers.
I had been playing with the idea of using stub zones or conditional forwarders, but based on my understanding, those methods will make the Domain Controllers to perform the DNS resolution themselves, instead of having the workstations contact the relevant nameservers.
What can you suggest to help solve this split-horizon problem?
Additional info:
- The AD FQDN is actually
id.company.com
, not company.com. - I made a mistake on the IP addresses above. Fixed.
You almost got your solution by yourself.
I'm assuming that
srv01.extra.company.com
is a server in your own company, so your nameservers are responsible for it.You are right in that you can't really use stub zones nor conditional forwarders, as the nameserver set up for this purpose will only see the queries originating by your AD DC's.1
But it's a common misconception that Active Directory must have set the DC's as it's nameservers, or that the clients need to resolve through the DC's.2
In this particular case, you would need to setup a proper BIND that cleanly resolves everything (that includes your AD!). After you have verified proper operation, you would add a zone
extra.company.com
to this server (effectively masking the real subdomain). In there, you can then override the records to your liking.Do note however that when this BIND tips over, your whole AD will come to a halt, since all queries by your clients go through this server. So set up accordingly (failover, backup, standby, et al).
1 Technically, this doesn't hold true for every case: If the client's resolver is capable of following referrals, the authoritative nameserver would see the query originating from the client. However, since almost all OS resolvers are stub resolvers, this doesn't really apply.
2 You can safely set even the authoritative NS of your AD to BIND server, but it sure isn't some fire-and-forget solution, it needs some work; for example adding specific records and allowing your DC's to update these. Microsoft has this well documented, refer to this article in Microsoft's Technet for a start. I usually avoid this alltogether, and instead have
company.com
served by a BIND, and delegate a subdomainad.company.com
to the AD. I don't think it's worth the hassle doing that in a existing AD though, like in your case.If you want to stick with Windows DNS, the feature that might help you is called Netmask Ordering with Round Robin. When you configure multiple A records for the same host, DNS will return results with priority based on client IP address and subnet. You can define what part of the address mask is used for netmask ordering, and since in your case it is /16, you also need to override default value (which is /24) with
Unfortunately, this will only cover the first two cases from your example, the third one will be tricky since only clients from 10.25.x.x will match the host mask.
If DNS is your only way of doing this, then I think your only real option here is to use BIND views.
AD workstations can point directly to BIND, as long as BIND forwards all requests for your AD domain to the AD DNS servers to resolve. We actually do this in the very large organisation I work for and everything works fine (dynamic updates, etc, included).
What service are these servers running? If they are HTTP you could possibly use something like HTTP redirects to bounce the user to their local server rather than using DNS splitting?