mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
hotfix: fixed CNAME issue that get introduced by previous changes.
This commit is contained in:
@@ -292,15 +292,20 @@ 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)
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_entries.AddOrUpdate(type, records, delegate (DnsResourceRecordType key, DnsResourceRecord[] existingRecords)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user