Bug 4208 - 'stub-no-cache' and 'forward-no-cache' not work
'stub-no-cache' and 'forward-no-cache' not work
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.8.1
x86_64 Linux
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-21 08:50 CET by Tao Dong
Modified: 2018-11-27 11:30 CET (History)
2 users (show)

See Also:


Attachments
My unbound conf file (2.06 KB, application/octet-stream)
2018-11-21 08:50 CET, Tao Dong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tao Dong 2018-11-21 08:50:09 CET
Created attachment 535 [details]
My unbound conf file

I turn on 'stub-no-cache' and 'forward-no-cache' in my conf file. But Unbound still cache the records. So I wonder how can I disable caching for stub zones and forward-zones?
Comment 1 Wouter Wijngaards 2018-11-23 12:48:24 CET
Hi Tao Dong,

Is this caused by the edns-client-subnet module?  It does not happen for me, when I set the option no-cache works as it should.  But I see edns-client-subnet options in the config you send, even though the edns-client-subnet does not seem enabled in that config.  The edns-client-subnet implementation has its own cache, which is not impacted by the no-cache options.

Best regards, Wouter
Comment 2 Tao Dong 2018-11-27 10:02:15 CET
(In reply to Wouter Wijngaards from comment #1)
> Hi Tao Dong,
> 
> Is this caused by the edns-client-subnet module?  It does not happen for me,
> when I set the option no-cache works as it should.  But I see
> edns-client-subnet options in the config you send, even though the
> edns-client-subnet does not seem enabled in that config.  The
> edns-client-subnet implementation has its own cache, which is not impacted
> by the no-cache options.
> 
> Best regards, Wouter

Thanks a lot! I think you are right. When I compile unbnound without '--enable-subnet', the options 'stub-no-cache' and 'forward-no-cache' work fine.However when compling with '--enable-subnet', the options do not work.
Comment 3 Wouter Wijngaards 2018-11-27 11:30:47 CET
Hi Tao Dong,

Thanks for the report and test without edns-subnet, I fixed the issue, and the no_cache option should work when you compile unbound with edns-subnet enabled.  The edns-subnet was using the flag itself to modify if the global cache was modified or the subnet cache, and this reset the value back to false, causing messages to get stored in cache.

Best regards, Wouter