I'm trying to configure, to call it in some way, a "lying" DNS server.
I mean: A DNS server which acts as a DNS cache (slave) for an existing server but having it's own subset of registers for a few domain names.
The desired behaviour is, for example:
When queried for "host.domain.com". If it has an entry for it in its own db, then answer with it.
If it isn't in its db, then ask it to the master (and optionally cache that answer).
I know I can put bind9 as a slave server but, this way, all queries will be responded with the same answer that the real server would be responded.
Of course, it is a tricky setup, I know, but it has an useful purpose:
Imagine you have complex services (for example Bacula backup configuration and scripts in my case) and you want to test it against real production servers before to put it in real production.
If I just could temporary redirect DNS to that "lying" DNS in a way that all names will be resolved as usual except a few subset of "maskeraded" hosts, it will behave just as a "real" setup but without actually messing real backup servers storage with testing backups.
Of course, I could use a list of entries in the /etc/hosts, but it requires more setup and is more error prone (I have the testing environments fully automated with Vagrant but IPs can change some times).
Cloning the server and using it to do the test, also requires more work and resources and, again, is more error prone because after the tests, I will need to reconfigure the real server by hand while, with the "lying dns" approach, I just need to restore the original resolv.conf file.
I successfully configured a master dns server for our domain and it resolves correctly its own entries and queries to other domains, but doesn't know about the data of the real domain servers.
I think that it should be possible to approach with bind, but I don't know where to search...