From 4adf0dc5d43bf6187b07170f886a60fa1176b8d6 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 12 Mar 2022 15:30:32 +0530 Subject: [PATCH] ForwarderZone: Updated implementation to allow adding NS records to make the zone work as an stub zone. --- DnsServerCore/Dns/Zones/ForwarderZone.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DnsServerCore/Dns/Zones/ForwarderZone.cs b/DnsServerCore/Dns/Zones/ForwarderZone.cs index 19f2f5f6..9229ab03 100644 --- a/DnsServerCore/Dns/Zones/ForwarderZone.cs +++ b/DnsServerCore/Dns/Zones/ForwarderZone.cs @@ -55,11 +55,10 @@ namespace DnsServerCore.Dns.Zones case DnsResourceRecordType.CNAME: throw new InvalidOperationException("Cannot set CNAME record at zone apex."); - case DnsResourceRecordType.NS: - throw new InvalidOperationException("Cannot set NS record at forwarder zone apex."); - case DnsResourceRecordType.SOA: - throw new InvalidOperationException("Cannot set SOA record at forwarder zone apex."); + case DnsResourceRecordType.DS: + case DnsResourceRecordType.APP: + throw new DnsServerException("The record type is not supported by forwarder zones."); default: base.SetRecords(type, records); @@ -71,8 +70,9 @@ namespace DnsServerCore.Dns.Zones { switch (record.Type) { - case DnsResourceRecordType.NS: - throw new InvalidOperationException("Cannot add NS record at forwarder zone apex."); + case DnsResourceRecordType.DS: + case DnsResourceRecordType.APP: + throw new DnsServerException("The record type is not supported by forwarder zones."); default: base.AddRecord(record);