Enable cachedb module for Unbound DNS

Started by Sandori, January 16, 2024, 12:59:51 PM

Previous topic - Next topic
January 16, 2024, 12:59:51 PM Last Edit: January 16, 2024, 01:17:48 PM by Sandori
Hi all,


I'm using OPNsense 23.7.11 on bare metal with a 500GB NVMe SSD and 16GB RAM.

I'm aware that Unbound clears the cache when the service restarts or the firewall is rebooted, so I'm interested in setting up a persistent/second-level cache. In my configuration, Unbound is set up as a recursive caching DNS, and everything is functioning well.

I've installed the os-redis plugin and would like to use it as the secondary cache.

According to the Unbound documentation, this can be achieved with the cachedb module, and you can enable it by updating /var/unbound/unbound.conf to include:module-config: "python validator cachedb iterator"


After saving unbound.conf and running configctl unbound check, I encounter the following error:
[1705404893] unbound-checkconf[36022:0] fatal error: module_conf lists module 'cachedb' but that module is not available.


When I run  unbound -V it shows that --enable-cachedb is missing in the configure line section.


Is there a way to enable this module? Are there better methods to achieve the same goal?

I'm open to suggestions, so I'd appreciate hearing your recommendations.

I forgot to mention that adding the following to unbound.conf made no difference due to the actual modules themselves missing.

cachedb:
    backend: redis
    redis-server-host: 127.0.0.1
    redis-server-port: 6379
    redis-timeout: 100
    redis-expire-records: no