Modifying cached results

Hello,

is it possible to modify responses from the unbound cache _just_before_
they are sent out to the client?

I want to replace NS records in a transparent zone - the NS records
should be unmodified for all the internal cache fetching operations, but
replaced for clients asking the cache.

Currently it looks as if the state machine does not call the operate()
action within pythonmod when the entry is found in the cache.

Best regards,
  Christof Chen

Hi Christof,

is it possible to modify responses from the unbound cache _just_before_
they are sent out to the client?

No

(unless you edit the code, it is open source :slight_smile: )

I want to replace NS records in a transparent zone - the NS records
should be unmodified for all the internal cache fetching operations, but
replaced for clients asking the cache.

This is not supported right now, the transparent zone determines
all of the answer depending on the query by the client.
Either it is all from static config, or all from the wire.

Currently it looks as if the state machine does not call the operate()
action within pythonmod when the entry is found in the cache.

Yes that is correct. This keeps some semblance of performance
while using pythonmod :slight_smile:

On a more serious note, also the other modules are not activated,
again, for performance reasons.

I have seen one solution to this by someone, by setting the TTL to zero
from pythonmod, you basically force no-caching on the result, and you
can modify every result sent to the client. (other queries are still
cached).

If you only want to have some NS used for queries by unbound, and not
sent to the client, perhaps you want a stub-zone definition and not a
transparent local-zone?

Best regards,
   Wouter