Is it possible, to set up BIND as DNS server on my local network, and make execute scripts when it gets a lookup?

I would like to execute a Python or Bash script, based on the incoming DNS lookup, how can I solve this?

If possible in Bind, please tell me how, and if not, tell me if it is possible in other DNS server implementations, that run on Ubuntu.

Thank you very much.