TechnitiumSoftware / DnsServer

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

Determine zone status via app #344

Open echodreamz opened 2 years ago

echodreamz commented 2 years ago

Is there a way to determine a zone's enabled status via an app?

ShreyasZare commented 2 years ago

Thanks for the post. If you meant the web app then yes, you can find if the zone is enabled from the web console and from the HTTP API.

echodreamz commented 2 years ago

Hello,

I meant from within an “app” or plugin. Technitium has a lot of cool apps to choose from, but none that do what I am looking for.

ShreyasZare commented 2 years ago

I meant from within an “app” or plugin. Technitium has a lot of cool apps to choose from, but none that do what I am looking for.

DNS Apps don't have direct access do the DNS server core. You can use the DirectQueryAsync() method to query with recursion desired set to false and find out if the zone is being served.

Another option is to use the HTTP API directly in the DNS App and get full control of the DNS server.

It will be great if you can describe what your are looking for implementing with the DNS apps since the DNS server is still evolving and interesting ideas can be added to it with every update.

echodreamz commented 2 years ago

When a zone is disabled, would like to return an A/CNAME record response to an IP/hostname of my choice to indicate to the end-user that the zone has been suspended/disabled. Basically the A record/CNAME response would point to a small web site that simply states the zone has been suspended etc. etc.

ShreyasZare commented 2 years ago

When a zone is disabled, would like to return an A/CNAME record response to an IP/hostname of my choice to indicate to the end-user that the zone has been suspended/disabled. Basically the A record/CNAME response would point to a small web site that simply states the zone has been suspended etc. etc.

There are multiple ways that I can think of to build this:

I will try to plan some options to allow DNS apps to be able to have more access to DNS server to make it easier to build apps that require such access.

echodreamz commented 2 years ago

Thanks...

Would be great if we could get a self-contained solution that did not rely on external data or having to pass around credentials for database servers and APIs. Especially, since this is a plugin of the DNS server, it could have direct access to the DNS server internals for such things.

ShreyasZare commented 2 years ago

Thanks...

* This could work, but this would also mean adding additional resources into the DNS server to query our control panel database system

* This could work, though, would be nice to differentiate between suspended and simply not existing

* Yes, though, having it self-contained without having to rely on storing credentials would be nice

Would be great if we could get a self-contained solution that did not rely on external data or having to pass around credentials for database servers and APIs. Especially, since this is a plugin of the DNS server, it could have direct access to the DNS server internals for such things.

Yes it will be quite useful to have a more access to the DNS server from the DNS Apps. Will plan to add more options to access and manage the DNS server via apps.