mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-02-25 09:17:32 +00:00
Zone: SetRecords() added check to prevent CNAME record from being set to zone root.
This commit is contained in:
@@ -204,7 +204,7 @@ namespace DnsServerCore.Dns
|
||||
}
|
||||
|
||||
foreach (Zone subDomain in subDomainsToDelete)
|
||||
currentZone._zones.TryRemove(subDomain._zoneLabel, out Zone deletedValue);
|
||||
currentZone._zones.TryRemove(subDomain._zoneLabel, out _);
|
||||
|
||||
return (currentZone._zones.Count == 0);
|
||||
}
|
||||
@@ -384,6 +384,9 @@ namespace DnsServerCore.Dns
|
||||
}
|
||||
}
|
||||
|
||||
if (_authoritativeZone && (type == DnsResourceRecordType.CNAME) && _entries.ContainsKey(DnsResourceRecordType.SOA))
|
||||
throw new DnsServerException("Cannot add CNAME record to zone root.");
|
||||
|
||||
_entries.AddOrUpdate(type, records, delegate (DnsResourceRecordType key, DnsResourceRecord[] existingValues)
|
||||
{
|
||||
return records;
|
||||
|
||||
Reference in New Issue
Block a user