view scripts/nameserver_autogen/bind_tld_zonefile @ 399:a6d7bb2e6a1f draft

Merge branch 'master' of git://1.3.9.1
author Ivo Smits <Ivo@UCIS.nl>
date Wed, 09 Feb 2011 19:00:20 +0100
parents c9b4cd6ac74e
children c95369b825a2
line wrap: on
line source

#!/usr/bin/php
<?php
print('$ttl 600'."\n");
chdir('../db/dom/ano');
$names = scandir('./');
foreach ($names as $name) {
 if (!file_exists($name.'/ns/')) continue;
 $servers = scandir($name.'/ns/');
 foreach ($servers as $server) {
  if ($server[0] == '.') continue;
  if (substr($name, -4) == ".ano") $name .= ".";
  $fqserver = $server;
  if (substr($server, -4) == ".ano") $fqserver .= ".";
  print($name.' IN NS '.$fqserver."\n");
  $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES |
   FILE_SKIP_EMPTY_LINES);
  foreach ($ips as $ip) {
   print($fqserver.' IN A '.$ip."\n");
  }
 }
}
?>