Changeset 112 for system/generators/dns.php
- Timestamp:
- Nov 9, 2008, 8:05:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/generators/dns.php
r103 r112 2 2 include_once('/a/www/centrala/global.php'); 3 3 4 //$Serial = '2007070601'; // Should be changed on every change5 4 $Serial = date('Ymds', time()); 6 5 $ExternalServerName = 'gw-hajda.inext.cz'; 6 $MinimumTime = 7200; 7 7 $RetryTime = 7200; 8 8 $ExpireTime = 2419200; 9 9 $RefreshTime = 28800; 10 $BaseDir = '/var/named/chroot/var/named/'; 10 11 // === Local network DNS server === 11 12 12 13 // Generate DNS records 13 $File = fopen( '/a/config/named_internal/var/named/zdechov.net.zone', 'w');14 $File = fopen($BaseDir.'internal/zdechov.net.zone', 'w'); 14 15 fputs($File,'$ORIGIN zdechov.net.'."\n". 15 16 '$TTL 86400'."\n". 16 17 "zdechov.net.\tIN\tSOA\tcentrala.zdechov.net.\troot.centrala.zdechov.net. (\n". 17 18 "\t\t\t".$Serial."\t; serial\n". 18 "\t\t\t 28800\t; refresh\n".19 "\t\t\t 14400\t; retry\n".20 "\t\t\t 3600000\t; expire\n".19 "\t\t\t".$RefreshTime."\t; refresh\n". 20 "\t\t\t".$RetryTime."\t; retry\n". 21 "\t\t\t".$ExpireTime."\t; expire\n". 21 22 "\t\t\t86400\t; ttl\n". 22 23 "\t\t\t)\n". … … 58 59 { 59 60 $Parts = explode('.', $Network); 60 $File = fopen( '/a/config/named_internal/var/named/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');61 $File = fopen($BaseDir.'internal/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 61 62 fputs($File, 62 63 '$TTL 86400'."\n". 63 64 "@\tIN\tSOA\tcentrala.zdechov.net.\troot.centrala.zdechov.net. (\n". 64 "\t\t\t\t".$Serial." 65 "\t\t\t\t28800; refresh\n".66 "\t\t\t\t 14400; retry\n".67 "\t\t\t\t 3600000; expire\n".65 "\t\t\t\t".$Serial."\t; serial\n". 66 "\t\t\t\t".$RefreshTime."\t; refresh\n". 67 "\t\t\t\t".$RetryTime."\t; retry\n". 68 "\t\t\t\t".$ExpireTime."\t; expire\n". 68 69 "\t\t\t\t86400 ; ttl\n". 69 70 "\t\t\t\t)\n". … … 83 84 { 84 85 $Parts = explode('.', $Network); 85 $File = fopen( '/a/config/named_internal/var/named/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');86 $File = fopen($BaseDir.'internal/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 86 87 fputs($File, 87 88 '$TTL 86400'."\n". 88 89 "@\tIN\tSOA\tcentrala.zdechov.net.\troot.centrala.zdechov.net. (\n". 89 "\t\t\t\t".$Serial." 90 "\t\t\t\t28800; refresh\n".91 "\t\t\t\t 14400; retry\n".92 "\t\t\t\t 3600000; expire\n".90 "\t\t\t\t".$Serial."\t; serial\n". 91 "\t\t\t\t".$RefreshTime."\t; refresh\n". 92 "\t\t\t\t".$RetryTime."\t; retry\n". 93 "\t\t\t\t".$ExpireTime."\t; expire\n". 93 94 "\t\t\t\t86400 ; ttl\n". 94 95 "\t\t\t\t)\n". … … 106 107 107 108 // Generate DNS records 108 $File = fopen( '/a/config/named_external/var/named/zdechov.net.zone', 'w');109 $File = fopen($BaseDir.'external/zdechov.net.zone', 'w'); 109 110 $Header = '$ORIGIN zdechov.net.'."\n". 110 111 '$TTL 86400'."\n". 111 112 "zdechov.net.\tIN\tSOA\t".$ExternalServerName.".\troot.centrala.zdechov.net. (\t\n". 112 113 "\t\t\t".$Serial."\t; serial\n". 113 "\t\t\t 28800\t; refresh\n".114 "\t\t\t".$RefreshTime."\t; refresh\n". 114 115 "\t\t\t".$RetryTime."\t; retry\n". 115 116 "\t\t\t".$ExpireTime."\t; expire\n". … … 136 137 { 137 138 $Data = strtolower($Alias['name']); 138 if(strlen($Data) <8) $Data .= "\t";139 if(strlen($Data) < 8) $Data .= "\t"; 139 140 fputs($File, $Data."\tIN\tCNAME\t".$Alias['target']."\n"); 140 141 } … … 147 148 { 148 149 $Parts = explode('.', $Network); 149 $File = fopen( '/a/config/named_external/var/named/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');150 $File = fopen($BaseDir.'external/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 150 151 fputs($File, 151 152 '$TTL 86400'."\n". 152 153 "@\tIN\tSOA\t".$ExternalServerName.".\troot.centrala.zdechov.net. (\n". 153 "\t\t\t\t".$Serial." 154 "\t\t\t\t28800; refresh\n".155 "\t\t\t\t".$RetryTime." 156 "\t\t\t\t".$ExpireTime." 154 "\t\t\t\t".$Serial."\t; serial\n". 155 "\t\t\t\t".$RefreshTime."\t; refresh\n". 156 "\t\t\t\t".$RetryTime."\t; retry\n". 157 "\t\t\t\t".$ExpireTime."\t; expire\n". 157 158 "\t\t\t\t86400 ; ttl\n". 158 159 "\t\t\t\t)\n". … … 174 175 175 176 // Generate DNS records 176 $File = fopen( '/a/config/named_czfree/var/named/zdechov.zlin.czf.zone', 'w');177 $File2 = fopen( '/a/config/named_internal/var/named/zdechov.zlin.czf.zone', 'w');177 $File = fopen($BaseDir.'czfree/zdechov.zlin.czf.zone', 'w'); 178 $File2 = fopen($BaseDir.'internal/zdechov.zlin.czf.zone', 'w'); 178 179 179 180 $Header = '$ORIGIN zdechov.zlin.czf.'."\n". … … 181 182 $Domain.".\tIN\tSOA\t".$Nameserver.".".$Domain.".\troot.".$Nameserver.".".$Domain." (\n". 182 183 "\t\t\t".$Serial."\t; serial\n". 183 "\t\t\t 28800\t; refresh\n".184 "\t\t\t".$RetryTime."\t; retry\n". 185 "\t\t\t 3600000\t; expire\n".184 "\t\t\t".$RefreshTime."\t; refresh\n". 185 "\t\t\t".$RetryTime."\t; retry\n". 186 "\t\t\t".$ExpireTime."\t; expire\n". 186 187 "\t\t\t86400\t; ttl\n". 187 188 "\t\t\t)\n". … … 197 198 $Domain.".\tIN\tSOA\t".$Nameserver.".".$Domain.".\troot.".$Nameserver.".".$Domain." (\n". 198 199 "\t\t\t".$Serial."\t; serial\n". 199 "\t\t\t28800\t; refresh\n". 200 "\t\t\t14400\t; retry\n". 201 "\t\t\t3600000\t; expire\n". 202 "\t\t\t86400\t; ttl\n". 200 "\t\t\t".$RefreshTime."\t; refresh\n". 201 "\t\t\t".$RetryTime."\t; retry\n". 202 "\t\t\t".$ExpireTime."\t; expire\n". 203 203 "\t\t\t)\n". 204 204 "\t\t\tTXT\t".'"Community network ZdechovNET"'."\n". … … 237 237 { 238 238 $Parts = explode('.', $Network); 239 $File = fopen( '/a/config/named_czfree/var/named/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');240 $File2 = fopen( '/a/config/named_internal/var/named/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');239 $File = fopen($BaseDir.'czfree/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 240 $File2 = fopen($BaseDir.'internal/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 241 241 $Nameserver = 'centrala'; 242 242 $Header = '$TTL 86400'."\n". 243 243 "@\tIN\tSOA\t".$Nameserver.".".$Domain.".\troot.".$Nameserver.".".$Domain.". (\n". 244 "\t\t\t\t".$Serial." 245 "\t\t\t\t28800; refresh\n".246 "\t\t\t\t 14400; retry\n".247 "\t\t\t\t 3600000; expire\n".244 "\t\t\t\t".$Serial."\t; serial\n". 245 "\t\t\t\t".$RefreshTime."\t; refresh\n". 246 "\t\t\t\t".$RetryTime."\t; retry\n". 247 "\t\t\t\t".$ExpireTime."\t; expire\n". 248 248 "\t\t\t\t86400 ; ttl\n". 249 249 "\t\t\t\t)\n". … … 255 255 $Header = '$TTL 86400'."\n". 256 256 "@\tIN\tSOA\t".$Nameserver.".".$Domain.".\troot.".$Nameserver.".".$Domain.". (\n". 257 "\t\t\t\t".$Serial." 258 "\t\t\t\t28800; refresh\n".259 "\t\t\t\t 14400; retry\n".260 "\t\t\t\t 3600000; expire\n".257 "\t\t\t\t".$Serial."\t; serial\n". 258 "\t\t\t\t".$RefreshTime."\t; refresh\n". 259 "\t\t\t\t".$RetryTime."\t; retry\n". 260 "\t\t\t\t".$ExpireTime."\t; expire\n". 261 261 "\t\t\t\t86400 ; ttl\n". 262 262 "\t\t\t\t)\n".
Note:
See TracChangeset
for help on using the changeset viewer.