Changeset 213 for trunk/system/generators/dns.php
- Timestamp:
- May 10, 2009, 12:30:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/dns.php
r211 r213 34 34 "\t\t\tMX\t10 ".$MailServer.".".$BaseDomain.".\n"); 35 35 36 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = Networ dInterface.Device WHERE NetworkInterface.LocalIP <> ""');36 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.LocalIP <> ""'); 37 37 while($Interface = $DbResult->fetch_assoc()) 38 38 { … … 45 45 46 46 // External records in internal server 47 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = Networ dInterface.Device WHERE NetworkInterface.ExternalIP <> ""');47 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP <> ""'); 48 48 while($Interface = $DbResult->fetch_assoc()) 49 49 { … … 117 117 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 118 118 $Name = strtolower($Name.'-ext'); 119 $IP = explode('.',$Inter afce['ExternalIP']);120 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name ])."-ext.".$BaseDomain.".\n");119 $IP = explode('.',$Interface['ExternalIP']); 120 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name)."-ext.".$BaseDomain.".\n"); 121 121 } 122 122 fclose($File); … … 191 191 "\t\t\tNS\t".$NameServers[1].".".$BaseDomain.".\n"); 192 192 193 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = Networ dInterface.Device WHERE NetworkInterface.ExternalIP LIKE "'.$Network.'.%"');193 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.ExternalIP LIKE "'.$Network.'.%"'); 194 194 while($Interface = $DbResult->fetch_assoc()) 195 195 { … … 197 197 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 198 198 $Name = strtolower($Name); 199 if(strlen($Name) < 8) $Name .= "\t";199 //if(strlen($Name) < 8) $Name .= "\t"; 200 200 $IP = explode('.', $Interface['ExternalIP']); 201 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($ Interface['Name']).".".$BaseDomain.".\n");201 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name).".".$BaseDomain.".\n"); 202 202 } 203 203 … … 254 254 fputs($File, $Name."\tIN\tA\t".$Interface['CZFreeIP']."\n"); 255 255 fputs($File2, $Name."\tIN\tA\t".$Interface['LocalIP']."\n"); 256 $Name = $Interface['DeviceName']; 257 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 258 $Name = strtolower($Name); 256 259 $Name .= '-czfree'; 257 260 fputs($File2, $Name."\tIN\tA\t".$Interface['CZFreeIP']."\n"); 258 261 } 259 262 260 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias` JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""'); 263 $DbResult = $Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`'); 264 // JOIN `hosts` ON NetworkDomainAlias.Target LIKE hosts.name AND hosts.czfree_ip != ""'); 261 265 while($Alias = $DbResult->fetch_assoc()) 262 266 { … … 303 307 fputs($File2, $Header); 304 308 305 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = Networ dInterface.Device WHERE NetworkInterface.CZFreeIP LIKE "'.$Network.'.%"');309 $DbResult = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM NetworkInterface JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE NetworkInterface.CZFreeIP LIKE "'.$Network.'.%"'); 306 310 while($Interface = $DbResult->fetch_assoc()) 307 311 { … … 309 313 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 310 314 $Name = strtolower($Name); 315 $Name2 = $Name; 311 316 if(strlen($Name) < 8) $Name .= "\t"; 312 317 $IP = explode('.', $Interface['CZFreeIP']); 313 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($ Interface['Name']).".".$Domain.".\n");314 fputs($File2, $IP[3]."\tIN\tPTR\t".strtolower($ Interface['Name'].'-czfree').".".$Domain.".\n");318 fputs($File, $IP[3]."\tIN\tPTR\t".strtolower($Name2).".".$Domain.".\n"); 319 fputs($File2, $IP[3]."\tIN\tPTR\t".strtolower($Name2.'-czfree').".".$Domain.".\n"); 315 320 } 316 321
Note:
See TracChangeset
for help on using the changeset viewer.