summaryrefslogtreecommitdiff
path: root/scripts/nameserver_autogen/bind_tld_zonefile
diff options
context:
space:
mode:
authorlex <lex@lynx.ano>2011-01-10 17:45:04 -0600
committerlex <lex@lynx.ano>2011-01-10 17:45:04 -0600
commit3466f25bd377b70c2b8930055603cfd4c9b08feb (patch)
treef32335ce1f81e7424793dd20d0777e85c8e21593 /scripts/nameserver_autogen/bind_tld_zonefile
parent267867f11141cd9a7d1293f95b8967271e99fabf (diff)
downloadresdb-3466f25bd377b70c2b8930055603cfd4c9b08feb.tar.gz
resdb-3466f25bd377b70c2b8930055603cfd4c9b08feb.zip
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
Diffstat (limited to 'scripts/nameserver_autogen/bind_tld_zonefile')
-rwxr-xr-xscripts/nameserver_autogen/bind_tld_zonefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile b/scripts/nameserver_autogen/bind_tld_zonefile
index 3850d92..344bb4e 100755
--- a/scripts/nameserver_autogen/bind_tld_zonefile
+++ b/scripts/nameserver_autogen/bind_tld_zonefile
@@ -8,12 +8,14 @@ foreach ($names as $name) {
$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");
}
}
}