dns icon indicating copy to clipboard operation
dns copied to clipboard

Add support for custom domain forwarders

Open jvandenbroek opened this issue 3 years ago • 5 comments
trafficstars

Currently I use dnsmasq in front of this docker, so i can resolve some custom domains with other DNS resolvers (eg. local domain to router). Would be nice if this resolver could support it, so I can drop dnsmasq in-between.

jvandenbroek avatar Apr 24 '22 11:04 jvandenbroek

+1 to that. Conditional Forwarders would be a very welcome addition.

Arderos avatar Dec 11 '22 16:12 Arderos

+1 Alternatively, if there is a mechanisms for including custom configuration into the root of the unbound.conf config . Something like this: https://github.com/qdm12/dns/compare/master...MichaelWasher:dns:master

MichaelWasher avatar Aug 17 '23 04:08 MichaelWasher

I would love to see this change as well. I'm using gluetun in a kubernetes cluster and would like for it to be able to look up DNS addresses in the cluster-dns. I have tested @MichaelWasher changes and confirmed that they are working.

CloudMass avatar Sep 14 '23 19:09 CloudMass

I just finished in commit 95ae9e8dcfeb4f432546bc3612069f4cec93cd9d with image qmcgaw/dns:v2.0.0-beta (beta still, almost done!), you can now use MIDDLEWARE_LOCALDNS_RESOLVERS=192.168.1.1:53 for example, and that will forward any requests for local domain names (like abc, abc.local, abc.nonexistingtld) to that address. For now it only works over plaintext DNS, but I don't see a need for tls etc. for the time being. You can also set multiple resolvers with commas in case you need this, and they'll be tried one by one. This will be plugged in Gluetun real soon, and should FINALLYYYY fix the issue where Gluetun cannot resolve local Docker/K8s hostnames!! Let me know if that fits your needs, or if you would need something else 😉 Thanks for your patience! 👍

qdm12 avatar Nov 26 '23 18:11 qdm12

Now it's even better, the local DNS middleware is enabled by default, and will auto-detect your system DNS servers, and try those for any local names it finds. So really zero configuration needed.

For now the limitation is it won't resolve a public TLD host like github.com to a local IP address, but if you would (please actually) need this, let me know and I can implement it within that same middleware 😉

qdm12 avatar Nov 29 '23 12:11 qdm12