[Unbound-users] Modifying answer with the Python API

Christophe Labonne galaf77 at gmail.com
Fri Oct 24 03:46:36 UTC 2014


Hello,

I work for a japanese internet provider and I would like to get some help
with the Python module I am currently working on.

Because of the way internet works in Japan, I need to filter the DNS
requests so that it doesn't show AAAA except for a few websites (as such, I
can't just use the parameter in the config file).

So I decided to build a Python module that would make it possible. Problem
is, it seems like I can modify the return_msg only when in event ==
MODULE_EVENT_NEW.

I do not wish to create data from the ground up, I would just like to
modify the existing answer.
The only way to do that would be to create a DNSMessage during event ==
MODULE_EVENT_MODDONE.

But if I do that, set_return_msg fails and returns 0.

Is there a way to create a DNSMessage during MODULE_EVENT_MODDONE?
Or is there a way to get original data during MODULE_EVENT_NEW so that I
can parse it?

I've been working on it for a day now and I just don't seem to find a good
way to do this.
(And yes, I know it's a weird thing to do but can't argue with the national
way of doing things)

I hope you guys can give me an answer and I wish you a good day.

Christophe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20141024/ae92efd7/attachment.htm>


More information about the Unbound-users mailing list