Bug 4208

Summary: 'stub-no-cache' and 'forward-no-cache' not work
Product: unbound Reporter: Tao Dong <dongtao4984>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: normal CC: cathya, wouter
Priority: P5    
Version: 1.8.1   
Hardware: x86_64   
OS: Linux   
Attachments: My unbound conf file

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