comparison scripts/nameserver_autogen/bind_tld_zonefile @ 349:59102e1e06f9 draft

Qualifying domain names in the bind generator script now
author lex <lex@lynx.ano>
date Tue, 11 Jan 2011 14:08:40 -0600
parents 2e7c94478881
children c9b4cd6ac74e
comparison
equal deleted inserted replaced
344:61d1265b506f 349:59102e1e06f9
6 foreach ($names as $name) { 6 foreach ($names as $name) {
7 if (!file_exists($name.'/ns/')) continue; 7 if (!file_exists($name.'/ns/')) continue;
8 $servers = scandir($name.'/ns/'); 8 $servers = scandir($name.'/ns/');
9 foreach ($servers as $server) { 9 foreach ($servers as $server) {
10 if ($server[0] == '.') continue; 10 if ($server[0] == '.') continue;
11 print($name.' IN NS '.$server."\n"); 11 if (substr($name, -4) == ".ano") $name .= ".";
12 $fqserver = $server;
13 if (substr($server, -4) == ".ano") $fqserver .= ".";
14 print($name.' IN NS '.$fqserver."\n");
12 $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES | 15 $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES |
13 FILE_SKIP_EMPTY_LINES); 16 FILE_SKIP_EMPTY_LINES);
14 foreach ($ips as $ip) { 17 foreach ($ips as $ip) {
15 print($server.' IN A '.$ip."\n"); 18 print($fqserver.' IN A '.$ip."\n");
16 } 19 }
17 } 20 }
18 } 21 }
19 ?> 22 ?>