changeset 341:4a4f9682f43e draft

Updated the bind generator script so that it checks that FQDNs are actually ending in . properly now so that stupid things don't happen whenever we transfer zones or, well, do anything with DNS
author lex <lex@lynx.ano>
date Mon, 10 Jan 2011 17:45:04 -0600
parents 1299c56b6d5c
children 0aecff46b1ac 5b0de48dd381
files scripts/nameserver_autogen/bind_tld_zonefile
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/nameserver_autogen/bind_tld_zonefile	Mon Jan 10 17:25:44 2011 -0600
+++ b/scripts/nameserver_autogen/bind_tld_zonefile	Mon Jan 10 17:45:04 2011 -0600
@@ -8,12 +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);
-  if (substr($server, -4, 4) == ".ano") $server .= ".";
   foreach ($ips as $ip) {
-   print($server.' IN A '.$ip."\n");
+   print($fqserver.' IN A '.$ip."\n");
   }
  }
 }