Maintained by: NLnet Labs

[Unbound-users] disable caching for stub zones

Alexander Dreweke
Thu Oct 2 08:53:11 CEST 2014


Hi

I'm running unbound 1.4.22 (AD) and looking for a way to disable caching
for all or some stub zones, as these zones are served by nsd (AA) on the
same machine:

server:
    private-domain: "example.net."
    private-domain: "example.com."

    private-address: "10.1.0.0/16"
    local-zone:      "1.10.in-addr.arpa." transparent
    domain-insecure: "1.10.in-addr.arpa." #remove after dnssec is enabled

    private-address: "10.2.0.0/16"
    local-zone:      "2.10.in-addr.arpa." transparent
    domain-insecure: "2.10.in-addr.arpa." #remove after dnssec is enabled

    domain-insecure: "example.com." #remove after dnssec is enabled
    domain-insecure: "example.net." #remove after dnssec is enabled

stub-zone:
    name:      "example.net."
    stub-addr: 127.0.0.1 at 54

stub-zone:
    name:      "example.com."
    stub-addr: 127.0.0.1 at 54

stub-zone:
    name:      "1.10.in-addr.arpa."
    stub-addr: 127.0.0.1 at 54

stub-zone:
    name:      "2.10.in-addr.arpa."
    stub-addr: 127.0.0.1 at 54

forward-zone:
    name:         "."
    forward-addr: 10.1.0.42

I found that I can evict the cache for the stub zones by running the
following commands wie cron every minute or so

unbound-control flush_zone example.net.
unbound-control flush_zone example.com.
unbound-control flush_zone 1.10.in-addr.arpa.
unbound-control flush_zone 2.10.in-addr.arpa.

Is there a better way to prevent unbound of caching these zones in the
first place or to reduce the cache time for these zones?

Regards
    Alex