comparison scripts/nameserver_autogen/bind_tld_zonefile @ 10:7e97054a5437 draft

added a script from UFO to autogenerate a bind TLD zonefile
author Nick <nick@somerandomnick.ano>
date Sun, 18 Apr 2010 21:29:21 +0000
parents
children 2e7c94478881
comparison
equal deleted inserted replaced
9:8f9565400a0f 10:7e97054a5437
1 <?php
2 print('$ttl 600'."\n");
3 chdir('../db/dom/ano');
4 $names = scandir('./');
5 foreach ($names as $name) {
6 if (!file_exists($name.'/ns/')) continue;
7 $servers = scandir($name.'/ns/');
8 foreach ($servers as $server) {
9 if ($server[0] == '.') continue;
10 print($name.' IN NS '.$server."\n");
11 $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES |
12 FILE_SKIP_EMPTY_LINES);
13 foreach ($ips as $ip) {
14 print($server.' IN A '.$ip."\n");
15 }
16 }
17 }
18 ?>