From 9ad490671d5e1f652aca1b26150e4c908a8dab75 Mon Sep 17 00:00:00 2001 From: Christopher York Date: Sat, 20 Oct 2012 18:54:33 -0500 Subject: [PATCH] Fix for previous patch for [ip] variable replace Fix should only apply to A and AAAA record values --- .../Code/DnsServers/DnsServerController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs index 2bb662ee..85c5eb6b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs @@ -281,15 +281,16 @@ namespace WebsitePanel.EnterpriseServer foreach (GlobalDnsRecord record in records) { - if (String.IsNullOrEmpty(serviceIP) && String.IsNullOrEmpty(record.ExternalIP)) - continue; - DnsRecord rr = new DnsRecord(); rr.RecordType = (DnsRecordType)Enum.Parse(typeof(DnsRecordType), record.RecordType, true); rr.RecordName = Utils.ReplaceStringVariable(record.RecordName, "host_name", hostName, true); if (record.RecordType == "A" || record.RecordType == "AAAA") { + // If the service IP address and the DNS records external address are empty / null SimpleDNS will fail to properly create the zone record + if (String.IsNullOrEmpty(serviceIP) && String.IsNullOrEmpty(record.ExternalIP)) + continue; + rr.RecordData = String.IsNullOrEmpty(record.RecordData) ? record.ExternalIP : record.RecordData; rr.RecordData = Utils.ReplaceStringVariable(rr.RecordData, "ip", string.IsNullOrEmpty(serviceIP) ? record.ExternalIP : serviceIP); @@ -322,7 +323,6 @@ namespace WebsitePanel.EnterpriseServer zoneRecords.Add(rr); } } - return zoneRecords; }