fix MsDns2012 NS record bug
This commit is contained in:
parent
9fc94fbcb9
commit
323e6d7ad6
2 changed files with 25 additions and 1 deletions
|
@ -365,7 +365,25 @@ namespace WebsitePanel.Providers.DNS
|
||||||
cmd.addParam( "Force" );
|
cmd.addParam( "Force" );
|
||||||
ps.RunPipeline( cmd );
|
ps.RunPipeline( cmd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Remove_DnsServerResourceRecords(this PowerShellHelper ps, string zoneName, string type)
|
||||||
|
{
|
||||||
|
var cmd = new Command("Get-DnsServerResourceRecord");
|
||||||
|
cmd.addParam("ZoneName", zoneName);
|
||||||
|
cmd.addParam("RRType", type);
|
||||||
|
Collection<PSObject> resourceRecords = ps.RunPipeline(cmd);
|
||||||
|
|
||||||
|
foreach (PSObject resourceRecord in resourceRecords)
|
||||||
|
{
|
||||||
|
cmd = new Command("Remove-DnsServerResourceRecord");
|
||||||
|
cmd.addParam("ZoneName", zoneName);
|
||||||
|
cmd.addParam("InputObject", resourceRecord);
|
||||||
|
|
||||||
|
cmd.addParam("Force");
|
||||||
|
ps.RunPipeline(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Update_DnsServerResourceRecordSOA(this PowerShellHelper ps, string zoneName,
|
public static void Update_DnsServerResourceRecordSOA(this PowerShellHelper ps, string zoneName,
|
||||||
TimeSpan ExpireLimit, TimeSpan MinimumTimeToLive, string PrimaryServer,
|
TimeSpan ExpireLimit, TimeSpan MinimumTimeToLive, string PrimaryServer,
|
||||||
TimeSpan RefreshInterval, string ResponsiblePerson, TimeSpan RetryDelay,
|
TimeSpan RefreshInterval, string ResponsiblePerson, TimeSpan RetryDelay,
|
||||||
|
|
|
@ -98,12 +98,18 @@ namespace WebsitePanel.Providers.DNS
|
||||||
public virtual void AddPrimaryZone( string zoneName, string[] secondaryServers )
|
public virtual void AddPrimaryZone( string zoneName, string[] secondaryServers )
|
||||||
{
|
{
|
||||||
ps.Add_DnsServerPrimaryZone( zoneName, secondaryServers );
|
ps.Add_DnsServerPrimaryZone( zoneName, secondaryServers );
|
||||||
|
|
||||||
|
// remove ns records
|
||||||
|
ps.Remove_DnsServerResourceRecords(zoneName, "NS");
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddSecondaryZone( string zoneName, string[] masterServers )
|
public virtual void AddSecondaryZone( string zoneName, string[] masterServers )
|
||||||
{
|
{
|
||||||
ps.Add_DnsServerSecondaryZone( zoneName, masterServers );
|
ps.Add_DnsServerSecondaryZone( zoneName, masterServers );
|
||||||
}
|
|
||||||
|
// remove ns records
|
||||||
|
ps.Remove_DnsServerResourceRecords(zoneName, "NS");
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void DeleteZone( string zoneName )
|
public virtual void DeleteZone( string zoneName )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue