TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.27k stars 418 forks source link

Dynamic zones based on "providers" similar to traefik #632

Closed apawsey closed 1 year ago

apawsey commented 1 year ago

I'm wanting to integrate this awesome project into my docker stack that I'm running for sonarr, radarr et al.

I'm using traefik as my reverse proxy, and traefik is doing an clever job of dynamically configuring itself based on its docker provider, where it picks up the routes from labels on the containers.

I'm hoping I could implement something similar with technitium, where it could use the labels to create a local zone to route network internal traffic to my stack. From having a quick browse at the source, it seems I could create an "app" that could reply to certain queries with the answers I want, but what bothers me is that there wouldn't be anything on the UI to indicate this process was going on... Obviously if I'm mistaken about any of that, please feel free to correct me.

What I was wondering about was creating a different app extension point, that allows the app to report to the zone store on additional zones/records that it is "providing". That way, the dynamically answered queries are not "invisibly" being handled.

Does that make any sense? Is this something that has been considered before? (I couldn't find anything in previous issues.) Or does everyone think I'm bonkers? :-D

To be clear, I'm planning on me developing this, not asking for someone else to put it together, just looking for feedback on the general idea.

Thanks.

ShreyasZare commented 1 year ago

Thanks for the post. I am not exactly getting the thing that you are describing. Do you mean that you want to set the docker labels for a container and then the DNS server should use it to load its config? If yes then something like that can be done. A DNS app can certainly be built that uses that info and works with it but apps cannot configure the DNS server.

I would suggest that you take a look at the HTTP API which you can use with a bash script (using curl and jd) and populate the zones and records you need automatically. This will give you much better control and will be straight forward to implement.

madson7 commented 1 month ago

Hello, any changes to the project that could make possible what was suggested by @apawsey regitrar the dns entry via labels?

ShreyasZare commented 1 month ago

Hello, any changes to the project that could make possible what was suggested by @apawsey regitrar the dns entry via labels?

@madson7 Thanks for asking. Docker container label based entries is a very specific thing to have a full feature for it. Its recommended to use scripts to do that.