From 4a342ef2ae9d8d84037c79411b7f467443bd189a Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 4 Aug 2018 15:11:15 +0530 Subject: [PATCH] web app: added UI setting for recursion only for private networks option. --- DnsServerCore/www/index.html | 7 ++++++- DnsServerCore/www/js/main.js | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/www/index.html b/DnsServerCore/www/index.html index c88aa0b8..4d9ecfef 100644 --- a/DnsServerCore/www/index.html +++ b/DnsServerCore/www/index.html @@ -552,8 +552,13 @@ Allow Recursion +
+ +
-
Enabling recursion will allow this DNS server to resolve any domain and act as a general purpose DNS server. Disable this option if you wish this server to act only as authoritative name server for the configured zones.
+
Enabling recursion will allow this DNS server to resolve any domain and act as a general purpose DNS server. Disable this option if you wish this server to act only as authoritative name server for the configured zones. Enable recursion only for private networks option if you do not what the DNS server to support recursion over Internet but want to support it on private networks.
diff --git a/DnsServerCore/www/js/main.js b/DnsServerCore/www/js/main.js index f55194a9..f906c56b 100644 --- a/DnsServerCore/www/js/main.js +++ b/DnsServerCore/www/js/main.js @@ -105,6 +105,11 @@ $(function () { } }); + $("#chkAllowRecursion").click(function () { + var allowRecursion = $("#chkAllowRecursion").prop('checked'); + $("#chkAllowRecursionOnlyForPrivateNetworks").prop('disabled', !allowRecursion); + }); + showPageLogin(); login("admin", "admin"); }); @@ -275,6 +280,8 @@ function loadDnsSettings() { $("#chkPreferIPv6").prop("checked", responseJSON.response.preferIPv6); $("#chkLogQueries").prop("checked", responseJSON.response.logQueries); $("#chkAllowRecursion").prop("checked", responseJSON.response.allowRecursion); + $("#chkAllowRecursionOnlyForPrivateNetworks").prop('disabled', !responseJSON.response.allowRecursion); + $("#chkAllowRecursionOnlyForPrivateNetworks").prop("checked", responseJSON.response.allowRecursionOnlyForPrivateNetworks); var proxy = responseJSON.response.proxy; if (proxy === null) { @@ -382,6 +389,7 @@ function saveDnsSettings() { var preferIPv6 = $("#chkPreferIPv6").prop('checked'); var logQueries = $("#chkLogQueries").prop('checked'); var allowRecursion = $("#chkAllowRecursion").prop('checked'); + var allowRecursionOnlyForPrivateNetworks = $("#chkAllowRecursionOnlyForPrivateNetworks").prop('checked'); var proxy; var proxyType = $('input[name=rdProxyType]:checked').val().toLowerCase(); @@ -414,7 +422,7 @@ function saveDnsSettings() { var btn = $("#btnSaveDnsSettings").button('loading'); HTTPRequest({ - url: "/api/setDnsSettings?token=" + token + "&serverDomain=" + serverDomain + "&webServicePort=" + webServicePort + "&preferIPv6=" + preferIPv6 + "&logQueries=" + logQueries + "&allowRecursion=" + allowRecursion + proxy + "&forwarders=" + forwarders + "&forwarderProtocol=" + forwarderProtocol, + url: "/api/setDnsSettings?token=" + token + "&serverDomain=" + serverDomain + "&webServicePort=" + webServicePort + "&preferIPv6=" + preferIPv6 + "&logQueries=" + logQueries + "&allowRecursion=" + allowRecursion + "&allowRecursionOnlyForPrivateNetworks=" + allowRecursionOnlyForPrivateNetworks + proxy + "&forwarders=" + forwarders + "&forwarderProtocol=" + forwarderProtocol, success: function (responseJSON) { document.title = "Technitium DNS Server " + responseJSON.response.version + " - " + responseJSON.response.serverDomain; $("#lblServerDomain").text(" - " + responseJSON.response.serverDomain);