From 1ca57a9f1bbe02444ac5c94f8816b19ef8e007fc Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 13 Jan 2019 16:04:50 +0530 Subject: [PATCH] DnsWebService: compatibility code added to disable zones from dns config v6. --- DnsServerCore/DnsWebService.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/DnsWebService.cs b/DnsServerCore/DnsWebService.cs index 89c74576..edeb9dbd 100644 --- a/DnsServerCore/DnsWebService.cs +++ b/DnsServerCore/DnsWebService.cs @@ -86,6 +86,8 @@ namespace DnsServerCore int _totalZonesAllowed; int _totalZonesBlocked; + List _configDisabledZones; + #endregion #region constructor @@ -3233,11 +3235,14 @@ namespace DnsServerCore if (version <= 6) { - //read for backward compatibility int count = bR.ReadInt32(); + _configDisabledZones = new List(count); for (int i = 0; i < count; i++) - bR.ReadShortString(); //read domain name + { + string domain = bR.ReadShortString(); + _configDisabledZones.Add(domain); + } } if (version > 4) @@ -3531,6 +3536,15 @@ namespace DnsServerCore LoadConfigFile(); LoadZoneFiles(); + if (_configDisabledZones != null) + { + foreach (string domain in _configDisabledZones) + { + _dnsServer.AuthoritativeZoneRoot.DisableZone(domain); + SaveZoneFile(domain); + } + } + ThreadPool.QueueUserWorkItem(delegate (object state) { try