From d813fe2fe17c2d58f1bfd34ba7e604d0b630e024 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 6 Mar 2022 16:01:09 +0530 Subject: [PATCH] AuthZone: Updated implementation to allow multiple PTR records. Minor validation check added. --- DnsServerCore/Dns/Zones/AuthZone.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/Dns/Zones/AuthZone.cs b/DnsServerCore/Dns/Zones/AuthZone.cs index 949126a9..df37d188 100644 --- a/DnsServerCore/Dns/Zones/AuthZone.cs +++ b/DnsServerCore/Dns/Zones/AuthZone.cs @@ -712,7 +712,6 @@ namespace DnsServerCore.Dns.Zones { case DnsResourceRecordType.CNAME: case DnsResourceRecordType.DNAME: - case DnsResourceRecordType.PTR: case DnsResourceRecordType.SOA: throw new InvalidOperationException("Cannot add record: use SetRecords() for " + record.Type.ToString() + " record"); } @@ -756,7 +755,9 @@ namespace DnsServerCore.Dns.Zones if (oldRecord.Type != newRecord.Type) throw new InvalidOperationException("Old and new record types do not match."); - DeleteRecord(oldRecord.Type, oldRecord.RDATA); + if (!DeleteRecord(oldRecord.Type, oldRecord.RDATA)) + throw new DnsWebServiceException("Cannot update record: the old record does not exists."); + AddRecord(newRecord); }