Discussion:
[Unbound-users] execute python module before cache lookup
Volodymyr Samodid
2015-01-09 20:08:40 UTC
Permalink
Hi all.
Many thanks for great software.

I want to ask a question. Is there any way to execute python module
before cache lookup ? I didn't find answer in documentation, but maybe
i've missed something or someone knows solution.
That feature needed for per host custom reply, with ability return
normal value for hosts without configured custom reply.
I want create application, something like distributed hosts file. It
should be useful in case if you can't modify hosts file ( have no
rights, no access to firmware, hard to synchronize files between several
machines). I have to use two unbound daemons ( frontend and backend) in
current prototype.

frontend - serves user requests with python module,if no custom replay
forward request to backend, cache disabled,
backend - works as normal unbound install

It works, but would be great to keep all in one place.

thanks
--
С уважением,
Самодед Владимир
SVAJ-RIPE|SVA88-UANIC
Yuri Schaeffer
2015-01-10 15:26:08 UTC
Permalink
Hi,
Is there any way to execute python module before cache lookup ?
No there isn't. But I think it would be easy to achieve if you are
willing to dig in the code. If you disable the initial cache lookup
and have your python module as first in line you could do this, I think.

The iterator and validator modules also have access to the cache, so
the performance hit wouldn't be that bad. And definitely better than
the current solution.

Regards,
Yuri

Loading...