hotfix: fixed CNAME issue that get introduced by previous changes.

This commit is contained in:
Shreyas Zare
2019-01-13 17:32:10 +05:30
parent 126f6977cb
commit c7ed22cef4

View File

@@ -292,13 +292,18 @@ namespace DnsServerCore
{
if (type == DnsResourceRecordType.CNAME)
{
if (!_zones.IsEmpty)
throw new DnsServerException("Cannot add CNAME record: sub domains exists in same zone");
foreach (DnsResourceRecordType key in _entries.Keys)
{
if (key != DnsResourceRecordType.SOA)
throw new DnsServerException("Cannot add CNAME record: other records exists in same zone");
switch (key)
{
case DnsResourceRecordType.SOA:
case DnsResourceRecordType.NS:
case DnsResourceRecordType.CNAME:
continue;
default:
throw new DnsServerException("Cannot add CNAME record: other records exists in same zone");
}
}
}