Ignore:
Timestamp:
Dec 23, 2008, 8:23:59 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Skripty pro generování nastavení routeru.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • system/generators/dns.php

    r122 r128  
    1010$BaseDir = '/var/named/chroot/var/named/';
    1111$MailServer = 'centrala';
     12$NameServers = array('centrala', 'tv');
    1213
    1314// === Local network DNS server ===
     
    1718fputs($File,'$ORIGIN zdechov.net.'."\n".
    1819'$TTL 86400'."\n".
    19 "zdechov.net.\tIN\tSOA\tns1.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\tns1.zdechov.net.\n".
    27 "\t\tIN\tNS\tns2.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".
    2829"\t\t\tTXT\t".'"community network ZdechovNET"'."\n".
    2930// "\t\tIN\tA\t192.168.0.1\n".
     
    6566  fputs($File,
    6667  '$TTL 86400'."\n".
    67   "@\tIN\tSOA\tns1.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\tns1.zdechov.net.\n".
    75   "\tIN\tNS\tns2.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");
    7677  $DbResult = $Database->select('hosts','*','IP LIKE "'.$Network.'%"');
    7778  while($Row = $DbResult->fetch_array())
     
    9192  fputs($File,
    9293  '$TTL 86400'."\n".
    93   "@\tIN\tSOA\tns1.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\tns1.zdechov.net.\n".
    101   "\tIN\tNS\tns2.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");
    102103  $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"');
    103104  while($Row = $DbResult->fetch_array())
     
    115116$Header = '$ORIGIN zdechov.net.'."\n".
    116117'$TTL 86400'."\n".
    117 "zdechov.net.\tIN\tSOA\tns1.zdechov.net.\troot.zdechov.net.     (\t\n".
     118"zdechov.net.\tIN\tSOA\t".$NameServers[0].".zdechov.net.\troot.zdechov.net.     (\t\n".
    118119"\t\t\t".$Serial."\t; serial\n".
    119120"\t\t\t".$RefreshTime."\t; refresh\n".
     
    123124"\t\t\t)\n".
    124125"\t\t\tTXT\t".'"community network ZdechovNET"'."\n".
    125 "\t\tIN\tNS\tns1.zdechov.net.\n".
    126 "\t\tIN\tNS\tns2.zdechov.net.\n".
     126"\t\tIN\tNS\t".$NameServers[0].".zdechov.net.\n".
     127"\t\tIN\tNS\t".$NameServers[1].".zdechov.net.\n".
    127128"\t\tIN\tNS\tplandsfeld.avonet.cz.\n";
    128129// "\t\tIN\tA\t81.2.194.142\n".
     
    141142{
    142143  $Data = strtolower($Row['name']);
    143   if(strlen($Data)<8) $Data .= "\t";
     144  if(strlen($Data) < 8) $Data .= "\t";
    144145  fputs($File,$Data."\tIN\tA\t".$Row['external_ip']."\n");
    145146}
     
    163164  fputs($File,
    164165  '$TTL 86400'."\n".
    165   "@\tIN\tSOA\tns1.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\tns1.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".
    173174  "\t\t\tNS\tplandsfeld.avonet.cz.\n".
    174   "\t\t\tNS\tns2.zdechov.net.\n");
     175  "\t\t\tNS\t".$NameServers[1].".zdechov.net.\n");
    175176
    176177  $DbResult = $Database->select('hosts','*','external_ip LIKE "'.$Network.'.%"');
     
    192193$Header = '$ORIGIN zdechov.zlin.czf.'."\n".
    193194'$TTL 86400'."\n".
    194 $Domain.".\tIN\tSOA\tns1.".$Domain.".\troot.".$Domain." (\n".
     195$Domain.".\tIN\tSOA\t".$NameServers[0].".".$Domain.".\troot.".$Domain." (\n".
    195196"\t\t\t".$Serial."\t; serial\n".
    196197"\t\t\t".$RefreshTime."\t; refresh\n".
     
    200201"\t\t\t)\n".
    201202"\t\t\tTXT\t".'"Community network ZdechovNET"'."\n".
    202 "\t\t\tNS\tns1.".$Domain.".\n".
    203 "\t\t\tNS\tns2.".$Domain.".\n".
     203"\t\t\tNS\t".$NameServers[0].".".$Domain.".\n".
     204"\t\t\tNS\t".$NameServers[1].".".$Domain.".\n".
    204205"\t\t\tNS\tserver.zlin.czf.\n";
    205206"\t\t\tMX\t10 ".$MailServer.".".$Domain.".\n";
     
    209210$Header = '$ORIGIN zdechov.zlin.czf.'."\n".
    210211'$TTL 86400'."\n".
    211 $Domain.".\tIN\tSOA\tns1.".$Domain.".\troot.".$Domain." (\n".
     212$Domain.".\tIN\tSOA\t".$NameServers[0].".".$Domain.".\troot.".$Domain." (\n".
    212213"\t\t\t".$Serial."\t; serial\n".
    213214"\t\t\t".$RefreshTime."\t; refresh\n".
     
    217218"\t\t\t)\n".
    218219"\t\t\tTXT\t".'"Community network ZdechovNET"'."\n".
    219 "\t\t\tNS\tns1.".$Domain.".\n".
    220 "\t\t\tNS\tns2.".$Domain.".\n".
     220"\t\t\tNS\t".$NameServers[0].".".$Domain.".\n".
     221"\t\t\tNS\t".$NameServers[1].".".$Domain.".\n".
    221222"\t\t\tNS\tserver.zlin.czf.\n";
    222223"\t\t\tMX\t10 ".$MailServer.".".$Domain.".\n";
     
    253254  $File = fopen($BaseDir.'czfree/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');
    254255  $File2 = fopen($BaseDir.'internal/'.$Parts[2].'.'.$Parts[1].'.'.$Parts[0].'.in-addr.arpa.zone', 'w+');
    255   $Nameserver = 'centrala';
    256256  $Header = '$TTL 86400'."\n".
    257   "@\tIN\tSOA\tns1.".$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\tns1.".$Domain.".\n".
    265   "@\tIN\tNS\tns2.".$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".
    266266  "\tIN\tNS\tserver.zlin.czf.\n\n";
    267267  fputs($File, $Header);
    268268
    269   $Nameserver = 'centrala-ext';
    270269  $Header = '$TTL 86400'."\n".
    271   "@\tIN\tSOA\tns1.".$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\tns1.".$Domain.".\n";
    279   "@\tIN\tNS\tns2.".$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";
    280279  "\tIN\tNS\tserver.zlin.czf.\n\n";
    281280
Note: See TracChangeset for help on using the changeset viewer.