diff 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
line wrap: on
line diff
--- a/scripts/nameserver_autogen/bind_tld_zonefile	Tue Jan 11 11:06:41 2011 -0500
+++ b/scripts/nameserver_autogen/bind_tld_zonefile	Tue Jan 11 14:08:40 2011 -0600
@@ -8,11 +8,14 @@
  $servers = scandir($name.'/ns/');
  foreach ($servers as $server) {
   if ($server[0] == '.') continue;
-  print($name.' IN NS '.$server."\n");
+  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($server.' IN A '.$ip."\n");
+   print($fqserver.' IN A '.$ip."\n");
   }
  }
 }