Change where the ReloadBIND was calld from, also fixed a typo.

This commit is contained in:
erikssonk 2013-09-17 16:56:39 +02:00
parent 82a60a73fd
commit d8b0f858a7

View file

@ -151,7 +151,7 @@ namespace WebsitePanel.Providers.DNS
soa.PrimaryNsServer = System.Net.Dns.GetHostEntry("LocalHost").HostName; soa.PrimaryNsServer = System.Net.Dns.GetHostEntry("LocalHost").HostName;
soa.PrimaryPerson = "hostmaster";//"hostmaster." + zoneName; soa.PrimaryPerson = "hostmaster";//"hostmaster." + zoneName;
records.Add(soa); records.Add(soa);
ReloadBIND("reconfig", "");
// add DNS zone // add DNS zone
UpdateZone(zoneName, records); UpdateZone(zoneName, records);
} }
@ -184,7 +184,7 @@ namespace WebsitePanel.Providers.DNS
File.Create(GetZoneFilePath(zoneName)).Close(); File.Create(GetZoneFilePath(zoneName)).Close();
// reload config // reload config
//ReloadBIND(); No need, we don't have a valid NS record, will generate a servfail on bind ReloadBIND("reconfig", "");
} }
public virtual DnsRecord[] GetZoneRecords(string zoneName) public virtual DnsRecord[] GetZoneRecords(string zoneName)
@ -254,9 +254,9 @@ namespace WebsitePanel.Providers.DNS
if (File.Exists(zonePath)) if (File.Exists(zonePath))
File.Delete(zonePath); File.Delete(zonePath);
// reload config // reload named.conf
ReloadBIND("reconfig", ""); ReloadBIND("reconfig", "");
} }
#endregion #endregion
#region Resource records #region Resource records
@ -818,6 +818,7 @@ namespace WebsitePanel.Providers.DNS
// update zone file // update zone file
UpdateZoneFile(zoneName, sb.ToString()); UpdateZoneFile(zoneName, sb.ToString());
ReloadBIND("reload", zoneName);
} }
private string CorrectRecordName(string zoneName, string host) private string CorrectRecordName(string zoneName, string host)
@ -911,11 +912,7 @@ namespace WebsitePanel.Providers.DNS
{ {
string path = GetZoneFilePath(zoneName); string path = GetZoneFilePath(zoneName);
File.WriteAllText(path, zoneContent); File.WriteAllText(path, zoneContent);
}
// This is need so bind reloads after update else you will get serverfail if new zone
// If update the change will not be accesseble from bind
ReloadBIND("reload", zoneName);
}
private string GetZoneFilePath(string zoneName) private string GetZoneFilePath(string zoneName)
{ {
@ -932,7 +929,7 @@ namespace WebsitePanel.Providers.DNS
// We don't use a bat file for reloading all zone files.. that's crazy talk // We don't use a bat file for reloading all zone files.. that's crazy talk
// Both bind 8 & 9 supports reloadind it's config and or reloading a single zone file // Both bind 8 & 9 supports reloadind it's config and or reloading a single zone file
// rndc reconfig Will reload named.conf (perfect when adding a primary zone) // rndc reconfig Will reload named.conf (perfect when adding a primary zone)
// rnd reload mydomain.com will reload the domain and only that domain // rndc reload mydomain.com will reload the domain and only that domain
// Used Bind Reload Batch for inputing correct path to rndc // Used Bind Reload Batch for inputing correct path to rndc
// Best Reguards, kenneth@cancode.se // Best Reguards, kenneth@cancode.se
Process rndc = new Process(); Process rndc = new Process();