qdm12 / dns

Docker DNS server on steroids to access DNS-over-TLS from Cloudflare, Google, Quad9, Quadrant or CleanBrowsing
https://hub.docker.com/r/qmcgaw/cloudflare-dns-server
MIT License
219 stars 37 forks source link

Feature Request: Add a parameter to make unbound forwarding entirely optional? #116

Open telnetdoogie opened 1 year ago

telnetdoogie commented 1 year ago

I'd like to see forward-zone be conditional for unbound so that unbound could be configured in recursive-only mode if no forwarders or providers are configured. (related to something I'd like to achieve with gluetun, as per my feature request here )

...I know that seems counterintuitive IN THIS SPECIFIC REPO, based on the intent of this package as it stands on its own, but unless there's a way to configure gluetun to use a different DNS package it sort of ties the two together, so gluetun can ONLY operate in forwarding mode, so long as this package is used.

I hacked my way into removing the forward-zone section in the config file in my own fork by modifying conf.go in that fork to test this out, and was able to successfully make a gluetun build that doesn't contain forwarders. This make gluetun and DNS work perfectly in recursive-only mode... however as you'll see it's a test/hack and would need to be made conditional based on some new environment variable, and I don't have the 'go' chops to make this happen and contribute an elegant solution.

Adding an environment variable like RECURSIVE_ONLY = true would be a nice way to achieve this.