Modifying query in C module

Hi,
We have a proprietary dns client that communicates with DNS resolver which is using unbound proxy. We have the need to encode some metadata and place it as part of query itself.

For e.g. request for www.microsoft.com will be changed in client to www.microsoft.com.mymeta. Then in mymodule_operate we would do some custom filtering based on mymeta and then strip out “.mymeta” to the next module, iterator.

  1. Could you point me to some sample code that does this kind of processing?

  2. Also, how would caching behave in the above model?

  3. On a related note, I assume we can use EDNS for passing such metadata. When is unbound support for EDNS with apis for extracting such data from OPT records planned?

I am currently using version 1.4.19 of unbound

Thanks much
Mani

Hi Many,

1. Could you point me to some sample code that does this kind of processing?
2. Also, how would caching behave in the above model?
3. On a related note, I assume we can use EDNS for passing such metadata.

Last January we had an extensive e-mail exchange about this. I provided
you with example code and pointers on how to implement your feature. As
for both solutions you need to make sure the initial cache lookup is
circumvented for your 'special' queries to ensure they arrive at your
module.

Whichever method you choose (I hope not the first) you will have to
modify the unbound sources to support your proprietary feature. Unbound
does not parse and export unknown edns options.

Regards,
Yuri Schaeffer

Yuri,
Thanks for your input. Just this week I started implementing the code changes based on the pointers you sent me earlier.
I have concluded that the clean way to do proprietary meta data transfer between client resolver and the unbound proxy is to place in an edns option.

Thanks
Mani