Merge
This commit is contained in:
parent
1d3c5a8a29
commit
837892e689
6 changed files with 18 additions and 10 deletions
|
@ -29,6 +29,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
@ -1213,6 +1214,17 @@ namespace WebsitePanel.EnterpriseServer
|
|||
DNSServer dns = new DNSServer();
|
||||
ServiceProviderProxy.Init(dns, zone.ServiceId);
|
||||
|
||||
DnsRecord[] domainRecords = dns.GetZoneRecords(zone.Name);
|
||||
var duplicateRecords = (from zoneRecord in domainRecords
|
||||
from resRecord in resourceRecords
|
||||
where zoneRecord.RecordName == resRecord.RecordName
|
||||
where zoneRecord.RecordType == resRecord.RecordType
|
||||
select zoneRecord).ToArray();
|
||||
if (duplicateRecords != null && duplicateRecords.Count() > 0)
|
||||
{
|
||||
dns.DeleteZoneRecords(zone.Name, duplicateRecords);
|
||||
}
|
||||
|
||||
// add new resource records
|
||||
dns.AddZoneRecords(zone.Name, resourceRecords.ToArray());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue