changeset 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 61d1265b506f
children c9b4cd6ac74e 6da9a57705cc 4fbc2e8407b0
files scripts/nameserver_autogen/bind_tld_zonefile
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
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");
   }
  }
 }