I work in Linux environment and I have a specific setup which requires me to have a DNS server which would only provide answers to queries which resolve to IPs which are whitelisted. This DNS will be accessed from internal machines only.
For example if it is provided with the following whitelist:
And domain foo.com resolves to 220.127.116.11 and domain bar.com resolves to 18.104.22.168, then it should provide a legitimate answer only for foo.com. For bar.com it should return "not found" or some other error.
I've read about Bind9's feature called Response Policy Zones (RPZ), but it seems it is only capable of blacklisting certain IPs.