Unbound Run Python Module by Some Condition

Hi,

I have set up a DNS-based application in unbound’s python module. So the module execution order is python → iterator. However, I only care a collection of incoming queries and I saved these sites in redis database. So I wonder if the following logic is possible in unbound:

If(Domain in Redis Database) {
Send to Python Module for resolution;
} else {
Send to Iterator + Cache for resolution;
}

The reason I want to do this is recently we had a unknown dos attack, and the python module made the cpu usage become about 85%+. And the cpu usage became normal after I disabled the python module.

Any response is appreciated.

Thank you!
Yisha