I have a new internal website going in place in multiple sites and I am looking to resolve the fqdn for it to the site specific subdomain depending on the source subnet used. The way our bind DNS is currently setup is that the fqdn resolution is master in site a and slaved to site b and c (all via puppet), so I cannot setup separate record files in site b and c with different answers to do this.
As an example, I want IPs in site a 172.10.0.0/16 to resolve server.domain.com to server.a.domain.com and IPs in site b 172.11.0.0/16 to resolve server.domain.com to server.b.domain.com etc
I have been looking at Bind RPZ but this doesnt seem to offer specific resolution options for subnets, only the ability to drop or block entire subnets unless I'm reading it wrong. I can get it to work to redirect the cname instead of forwarding to the correct zone for resolution, but then this is applied generally to all servers not using a client IP trigger like I am trying to use and I might as well be updating the CNAME in the domain.com zone.
added to name.d.conf.options
response-policy { zone "rpz"; };
rpz zone file
zone "rpz" {
type master;
file "/etc/named/zones/rpz/db.rpz.conf";
allow-query { none; };
};
dbfile
@ IN SOA nstest.domain.com. domain.com. (
2 ; serial
3H ; refresh
1H ; retry
1W ; expiry
1H) ; minimum
@ IN NS nstest.domain.com. ; destination IP rewrite
16.0.0.16.172.rpz-ip CNAME server.domain.com.
server.domain.com CNAME server.a.domain.com.
With these settings all requests to server.domain.com via this ns no matter the source IP resolve to server.a.domain.com
Or is trying to use RPZ the wrong method for this, I've also seen bind views in my research, but that looks like you have to recreate the entire zone file for each site, I'm just wanting to modify a single CNAME record.
Any help appreciated.