From 91f76d4138eb664d3f1b14be89d9e08d942a13ee Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 26 Mar 2022 11:56:52 +0530 Subject: [PATCH] WebServiceOtherZonesApi: implemented API support for flushing Allowed and Blocked zones. --- DnsServerCore/WebServiceOtherZonesApi.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/DnsServerCore/WebServiceOtherZonesApi.cs b/DnsServerCore/WebServiceOtherZonesApi.cs index b00e0f17..b03553dc 100644 --- a/DnsServerCore/WebServiceOtherZonesApi.cs +++ b/DnsServerCore/WebServiceOtherZonesApi.cs @@ -1,6 +1,6 @@ /* Technitium DNS Server -Copyright (C) 2021 Shreyas Zare (shreyas@technitium.com) +Copyright (C) 2022 Shreyas Zare (shreyas@technitium.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -265,6 +265,14 @@ namespace DnsServerCore } } + public void FlushAllowedZone(HttpListenerRequest request) + { + _dnsWebService.DnsServer.AllowedZoneManager.Flush(); + + _dnsWebService.Log.Write(DnsWebService.GetRequestRemoteEndPoint(request), "[" + _dnsWebService.GetSession(request).Username + "] Allowed zone was flushed successfully."); + _dnsWebService.DnsServer.AllowedZoneManager.SaveZoneFile(); + } + public void AllowZone(HttpListenerRequest request) { string domain = request.QueryString["domain"]; @@ -416,6 +424,14 @@ namespace DnsServerCore } } + public void FlushBlockedZone(HttpListenerRequest request) + { + _dnsWebService.DnsServer.BlockedZoneManager.Flush(); + + _dnsWebService.Log.Write(DnsWebService.GetRequestRemoteEndPoint(request), "[" + _dnsWebService.GetSession(request).Username + "] Blocked zone was flushed successfully."); + _dnsWebService.DnsServer.BlockedZoneManager.SaveZoneFile(); + } + public void BlockZone(HttpListenerRequest request) { string domain = request.QueryString["domain"];