Is it possible (and if so, how) to set up a DNS server that would behave like this: 1. Try to resolve DNS query through DNS1 server (given by IP). If domain exists, return to client. If domain does not exist continue. 2. Try to resolve DNS query through DNS2 server (given by IP). Whether domain exists or not return result to client.
It might be good enough if the distinction which server to contact is done based on domain name to be resolved. Eg. *.abc.com and *.bcd.com are resolved using DNS1 and rest is resolved using DNS2. However the preferred way would be to always try DNS1 first and then DNS2 if DNS1 doesn't know about the domain.
As an additional feature it would be good to be able to change all responses from DNS2 that fall into private IP range (e. 10.61.0.0) to point to different IP address range (e. 10.41.0.0). This is because the two networks have some conflicting IP ranges.
This can be done on both Windows 10 or Ubuntu Linux (I have no particular preference here), but other than OS license should be free.