diff --git a/setup/start.sh b/setup/start.sh index be1d11869..585db64f8 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -83,7 +83,7 @@ echo "==> Setting up unbound" # We listen on 0.0.0.0 because there is no way control ordering of docker (which creates the 172.18.0.0/16) and unbound # If IP6 is not enabled, dns queries seem to fail on some hosts. -s returns false if file missing or 0 size ip6=$([[ -s /proc/net/if_inet6 ]] && echo "yes" || echo "no") -echo -e "server:\n\tinterface: 0.0.0.0\n\tdo-ip6: ${ip6}\n\taccess-control: 127.0.0.1 allow\n\taccess-control: 172.18.0.1/16 allow\n\tcache-max-negative-ttl: 30\n\tcache-max-ttl: 300\n\t#logfile: /var/log/unbound.log\n\t#verbosity: 10" > /etc/unbound/unbound.conf.d/cloudron-network.conf +cp -f "${script_dir}/start/unbound.conf" /etc/unbound/unbound.conf.d/cloudron-network.conf # update the root anchor after a out-of-disk-space situation (see #269) unbound-anchor -a /var/lib/unbound/root.key diff --git a/setup/start/unbound.conf b/setup/start/unbound.conf new file mode 100644 index 000000000..db0a361d6 --- /dev/null +++ b/setup/start/unbound.conf @@ -0,0 +1,11 @@ +server: + interface: 0.0.0.0 + do-ip6: no + access-control: 127.0.0.1 allow + access-control: 172.18.0.1/16 allow + cache-max-negative-ttl: 30 + cache-max-ttl: 300 + # enable below for logging to journalctl -u unbound + # verbosity: 5 + # log-queries: yes +