Changeset 128 for system/generators/dns.php
- Timestamp:
- Dec 23, 2008, 8:23:59 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/generators/dns.php
r122 r128 10 10 $BaseDir = '/var/named/chroot/var/named/'; 11 11 $MailServer = 'centrala'; 12 $NameServers = array('centrala', 'tv'); 12 13 13 14 // === Local network DNS server === … … 17 18 fputs($File,'$ORIGIN zdechov.net.'."\n". 18 19 '$TTL 86400'."\n". 19 "zdechov.net.\tIN\tSOA\t ns1.zdechov.net.\troot.zdechov.net. (\n".20 "\t\t\t".$Serial."\t; serial\n". 21 "\t\t\t".$RefreshTime."\t; refresh\n". 22 "\t\t\t".$RetryTime."\t; retry\n". 23 "\t\t\t".$ExpireTime."\t; expire\n". 24 "\t\t\t".$MinimumTime."\t; minimum\n". 25 "\t\t\t)\n". 26 "\t\tIN\tNS\t ns1.zdechov.net.\n".27 "\t\tIN\tNS\t ns2.zdechov.net.\n".20 "zdechov.net.\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net. (\n". 21 "\t\t\t".$Serial."\t; serial\n". 22 "\t\t\t".$RefreshTime."\t; refresh\n". 23 "\t\t\t".$RetryTime."\t; retry\n". 24 "\t\t\t".$ExpireTime."\t; expire\n". 25 "\t\t\t".$MinimumTime."\t; minimum\n". 26 "\t\t\t)\n". 27 "\t\tIN\tNS\t".$NameServers[0].".zdechov.net.\n". 28 "\t\tIN\tNS\t".$NameServers[1].".zdechov.net.\n". 28 29 "\t\t\tTXT\t".'"community network ZdechovNET"'."\n". 29 30 // "\t\tIN\tA\t192.168.0.1\n". … … 65 66 fputs($File, 66 67 '$TTL 86400'."\n". 67 "@\tIN\tSOA\t ns1.zdechov.net.\troot.zdechov.net. (\n".68 "\t\t\t\t".$Serial."\t; serial\n". 69 "\t\t\t\t".$RefreshTime."\t; refresh\n". 70 "\t\t\t\t".$RetryTime."\t; retry\n". 71 "\t\t\t\t".$ExpireTime."\t; expire\n". 72 "\t\t\t\t".$MinimumTime."\t; minimum\n". 73 "\t\t\t\t)\n". 74 "@\tIN\tNS\t ns1.zdechov.net.\n".75 "\tIN\tNS\t ns2.zdechov.net.\n\n");68 "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net. (\n". 69 "\t\t\t\t".$Serial."\t; serial\n". 70 "\t\t\t\t".$RefreshTime."\t; refresh\n". 71 "\t\t\t\t".$RetryTime."\t; retry\n". 72 "\t\t\t\t".$ExpireTime."\t; expire\n". 73 "\t\t\t\t".$MinimumTime."\t; minimum\n". 74 "\t\t\t\t)\n". 75 "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n". 76 "\tIN\tNS\t".$NameServers[1].".zdechov.net.\n\n"); 76 77 $DbResult = $Database->select('hosts','*','IP LIKE "'.$Network.'%"'); 77 78 while($Row = $DbResult->fetch_array()) … … 91 92 fputs($File, 92 93 '$TTL 86400'."\n". 93 "@\tIN\tSOA\t ns1.zdechov.net.\troot.zdechov.net. (\n".94 "\t\t\t\t".$Serial."\t; serial\n". 95 "\t\t\t\t".$RefreshTime."\t; refresh\n". 96 "\t\t\t\t".$RetryTime."\t; retry\n". 97 "\t\t\t\t".$ExpireTime."\t; expire\n". 98 "\t\t\t\t".$MinimumTime."\t; minimum\n". 99 "\t\t\t\t)\n". 100 "@\tIN\tNS\t ns1.zdechov.net.\n".101 "\tIN\tNS\t ns2.zdechov.net.\n\n");94 "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net. (\n". 95 "\t\t\t\t".$Serial."\t; serial\n". 96 "\t\t\t\t".$RefreshTime."\t; refresh\n". 97 "\t\t\t\t".$RetryTime."\t; retry\n". 98 "\t\t\t\t".$ExpireTime."\t; expire\n". 99 "\t\t\t\t".$MinimumTime."\t; minimum\n". 100 "\t\t\t\t)\n". 101 "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n". 102 "\tIN\tNS\t".$NameServers[1].".zdechov.net.\n\n"); 102 103 $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"'); 103 104 while($Row = $DbResult->fetch_array()) … … 115 116 $Header = '$ORIGIN zdechov.net.'."\n". 116 117 '$TTL 86400'."\n". 117 "zdechov.net.\tIN\tSOA\t ns1.zdechov.net.\troot.zdechov.net. (\t\n".118 "zdechov.net.\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net. (\t\n". 118 119 "\t\t\t".$Serial."\t; serial\n". 119 120 "\t\t\t".$RefreshTime."\t; refresh\n". … … 123 124 "\t\t\t)\n". 124 125 "\t\t\tTXT\t".'"community network ZdechovNET"'."\n". 125 "\t\tIN\tNS\t ns1.zdechov.net.\n".126 "\t\tIN\tNS\t ns2.zdechov.net.\n".126 "\t\tIN\tNS\t".$NameServers[0].".zdechov.net.\n". 127 "\t\tIN\tNS\t".$NameServers[1].".zdechov.net.\n". 127 128 "\t\tIN\tNS\tplandsfeld.avonet.cz.\n"; 128 129 // "\t\tIN\tA\t81.2.194.142\n". … … 141 142 { 142 143 $Data = strtolower($Row['name']); 143 if(strlen($Data) <8) $Data .= "\t";144 if(strlen($Data) < 8) $Data .= "\t"; 144 145 fputs($File,$Data."\tIN\tA\t".$Row['external_ip']."\n"); 145 146 } … … 163 164 fputs($File, 164 165 '$TTL 86400'."\n". 165 "@\tIN\tSOA\t ns1.zdechov.net.\troot.zdechov.net. (\n".166 "\t\t\t\t".$Serial."\t; serial\n". 167 "\t\t\t\t".$RefreshTime."\t; refresh\n". 168 "\t\t\t\t".$RetryTime."\t; retry\n". 169 "\t\t\t\t".$ExpireTime."\t; expire\n". 170 "\t\t\t\t".$MinimumTime."\t; minimum\n". 171 "\t\t\t\t)\n". 172 "@\tIN\tNS\t ns1.zdechov.net.\n\n".166 "@\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net. (\n". 167 "\t\t\t\t".$Serial."\t; serial\n". 168 "\t\t\t\t".$RefreshTime."\t; refresh\n". 169 "\t\t\t\t".$RetryTime."\t; retry\n". 170 "\t\t\t\t".$ExpireTime."\t; expire\n". 171 "\t\t\t\t".$MinimumTime."\t; minimum\n". 172 "\t\t\t\t)\n". 173 "@\tIN\tNS\t".$NameServers[0].".zdechov.net.\n\n". 173 174 "\t\t\tNS\tplandsfeld.avonet.cz.\n". 174 "\t\t\tNS\t ns2.zdechov.net.\n");175 "\t\t\tNS\t".$NameServers[1].".zdechov.net.\n"); 175 176 176 177 $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"'); … … 192 193 $Header = '$ORIGIN zdechov.zlin.czf.'."\n". 193 194 '$TTL 86400'."\n". 194 $Domain.".\tIN\tSOA\t ns1.".$Domain.".\troot.".$Domain." (\n".195 $Domain.".\tIN\tSOA\t".$NameServers[0].".".$Domain.".\troot.".$Domain." (\n". 195 196 "\t\t\t".$Serial."\t; serial\n". 196 197 "\t\t\t".$RefreshTime."\t; refresh\n". … … 200 201 "\t\t\t)\n". 201 202 "\t\t\tTXT\t".'"Community network ZdechovNET"'."\n". 202 "\t\t\tNS\t ns1.".$Domain.".\n".203 "\t\t\tNS\t ns2.".$Domain.".\n".203 "\t\t\tNS\t".$NameServers[0].".".$Domain.".\n". 204 "\t\t\tNS\t".$NameServers[1].".".$Domain.".\n". 204 205 "\t\t\tNS\tserver.zlin.czf.\n"; 205 206 "\t\t\tMX\t10 ".$MailServer.".".$Domain.".\n"; … … 209 210 $Header = '$ORIGIN zdechov.zlin.czf.'."\n". 210 211 '$TTL 86400'."\n". 211 $Domain.".\tIN\tSOA\t ns1.".$Domain.".\troot.".$Domain." (\n".212 $Domain.".\tIN\tSOA\t".$NameServers[0].".".$Domain.".\troot.".$Domain." (\n". 212 213 "\t\t\t".$Serial."\t; serial\n". 213 214 "\t\t\t".$RefreshTime."\t; refresh\n". … … 217 218 "\t\t\t)\n". 218 219 "\t\t\tTXT\t".'"Community network ZdechovNET"'."\n". 219 "\t\t\tNS\t ns1.".$Domain.".\n".220 "\t\t\tNS\t ns2.".$Domain.".\n".220 "\t\t\tNS\t".$NameServers[0].".".$Domain.".\n". 221 "\t\t\tNS\t".$NameServers[1].".".$Domain.".\n". 221 222 "\t\t\tNS\tserver.zlin.czf.\n"; 222 223 "\t\t\tMX\t10 ".$MailServer.".".$Domain.".\n"; … … 253 254 $File = fopen($BaseDir.'czfree/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 254 255 $File2 = fopen($BaseDir.'internal/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+'); 255 $Nameserver = 'centrala';256 256 $Header = '$TTL 86400'."\n". 257 "@\tIN\tSOA\t ns1.".$Domain.".\troot.".$Domain.". (\n".258 "\t\t\t\t".$Serial."\t; serial\n". 259 "\t\t\t\t".$RefreshTime."\t; refresh\n". 260 "\t\t\t\t".$RetryTime."\t; retry\n". 261 "\t\t\t\t".$ExpireTime."\t; expire\n". 262 "\t\t\t\t".$MinimumTime."\t; minimum\n". 263 "\t\t\t\t)\n". 264 "@\tIN\tNS\t ns1.".$Domain.".\n".265 "@\tIN\tNS\t ns2.".$Domain.".\n".257 "@\tIN\tSOA\t".$NameServers[0].".".$Domain.".\troot.".$Domain.". (\n". 258 "\t\t\t\t".$Serial."\t; serial\n". 259 "\t\t\t\t".$RefreshTime."\t; refresh\n". 260 "\t\t\t\t".$RetryTime."\t; retry\n". 261 "\t\t\t\t".$ExpireTime."\t; expire\n". 262 "\t\t\t\t".$MinimumTime."\t; minimum\n". 263 "\t\t\t\t)\n". 264 "@\tIN\tNS\t".$NameServers[0].".".$Domain.".\n". 265 "@\tIN\tNS\t".$NameServers[1].".".$Domain.".\n". 266 266 "\tIN\tNS\tserver.zlin.czf.\n\n"; 267 267 fputs($File, $Header); 268 268 269 $Nameserver = 'centrala-ext';270 269 $Header = '$TTL 86400'."\n". 271 "@\tIN\tSOA\t ns1.".$Domain.".\troot.".$Domain.". (\n".272 "\t\t\t\t".$Serial."\t; serial\n". 273 "\t\t\t\t".$RefreshTime."\t; refresh\n". 274 "\t\t\t\t".$RetryTime."\t; retry\n". 275 "\t\t\t\t".$ExpireTime."\t; expire\n". 276 "\t\t\t\t".$MinimumTime."\t; minimum\n". 277 "\t\t\t\t)\n". 278 "@\tIN\tNS\t ns1.".$Domain.".\n";279 "@\tIN\tNS\t ns2.".$Domain.".\n";270 "@\tIN\tSOA\t".$NameServers[0]."-ext.".$Domain.".\troot.".$Domain.". (\n". 271 "\t\t\t\t".$Serial."\t; serial\n". 272 "\t\t\t\t".$RefreshTime."\t; refresh\n". 273 "\t\t\t\t".$RetryTime."\t; retry\n". 274 "\t\t\t\t".$ExpireTime."\t; expire\n". 275 "\t\t\t\t".$MinimumTime."\t; minimum\n". 276 "\t\t\t\t)\n". 277 "@\tIN\tNS\t".$NameServers[0]."-ext.".$Domain.".\n"; 278 "@\tIN\tNS\t".$NameServers[1]."-ext.".$Domain.".\n"; 280 279 "\tIN\tNS\tserver.zlin.czf.\n\n"; 281 280
Note:
See TracChangeset
for help on using the changeset viewer.