Unbound is a validating, recursive, caching DNS resolver.
Unbound is compiled with the --enable-cachedb and --with-libhiredis flags, allowing it to use Redis as a second level cache and persist resolved DNS queries across container restarts. More details about this module can be found here.
docker run \
--name unbound \
-p 53:53/tcp \
-p 53:53/udp \
ghcr.io/jeremyrea/unbound-docker:latestAdd the following configuration file to connect to your Redis instance:
server:
module-config: "validator cachedb iterator"
cachedb:
backend: "redis"
# secret seed string to calculate hashed keys
secret-seed: "my-secret"
# redis server's IP address or host name
redis-server-host: 127.0.0.1
# redis server's TCP port
redis-server-port: 6379
# timeout (in ms) for communication with the redis server
redis-timeout: 100
# set timeout on redis records based on DNS response TTL
redis-expire-records: yes
docker run \
--name unbound \
-p 53:53/tcp \
-p 53:53/udp \
-v /path/to/config:/opt/unbound/etc/unbound/unbound.conf.d \
ghcr.io/jeremyrea/unbound-docker:latestAny other configs you wish to add or modify from the image defaults can be done by adding more .conf files inside the unbound.conf.d directory. A full list of available settings is available on Unbound's documentation.