From 7f9d4fa063a074fb66cf6aa489cf79c392260633 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 13 Jun 2020 17:27:55 +0530 Subject: [PATCH] AuthZoneInfo: implemented RefreshZone() method to allow refreshing secondary & stub zones. --- DnsServerCore/Dns/Zones/AuthZoneInfo.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/DnsServerCore/Dns/Zones/AuthZoneInfo.cs b/DnsServerCore/Dns/Zones/AuthZoneInfo.cs index c09b9772..8ca2df78 100644 --- a/DnsServerCore/Dns/Zones/AuthZoneInfo.cs +++ b/DnsServerCore/Dns/Zones/AuthZoneInfo.cs @@ -125,6 +125,26 @@ namespace DnsServerCore.Dns.Zones return _zone.GetRecords(type); } + public void RefreshZone() + { + if (_zone == null) + throw new InvalidOperationException(); + + switch (_type) + { + case AuthZoneType.Secondary: + (_zone as SecondaryZone).RefreshZone(); + break; + + case AuthZoneType.Stub: + (_zone as StubZone).RefreshZone(); + break; + + default: + throw new InvalidOperationException(); + } + } + public void WriteTo(BinaryWriter bW) { if (_zone == null)