Take a look at PowerDNS Recursor or Unbound, both of which have scripting capabilities than enable this type of behavior and much more (Lua for PowerDNS, Python for Unbound).<p>I&#x27;d say a script for any of these would be a better choice.