mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-01 06:20:38 +00:00
WebService: Updated ResolveQuery() import feature to allow primary and forwarder zones for import.
This commit is contained in:
@@ -3220,14 +3220,24 @@ namespace DnsServerCore
|
||||
if (zoneInfo == null)
|
||||
throw new DnsServerException("Cannot import records: failed to create primary zone.");
|
||||
}
|
||||
else if (zoneInfo.Type != AuthZoneType.Primary)
|
||||
else
|
||||
{
|
||||
throw new DnsServerException("Cannot import records: import zone type must be primary.");
|
||||
switch (zoneInfo.Type)
|
||||
{
|
||||
case AuthZoneType.Primary:
|
||||
case AuthZoneType.Forwarder:
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new DnsServerException("Cannot import records: import zone must be of primary or forwarder type.");
|
||||
}
|
||||
}
|
||||
|
||||
if (type == DnsResourceRecordType.AXFR)
|
||||
{
|
||||
_dnsServer.AuthZoneManager.SyncRecords(domain, dnsResponse.Answer);
|
||||
bool dontRemoveRecords = zoneInfo.Type == AuthZoneType.Forwarder;
|
||||
|
||||
_dnsServer.AuthZoneManager.SyncRecords(domain, dnsResponse.Answer, null, dontRemoveRecords);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user