summaryrefslogtreecommitdiff
path: root/scripts/nameserver_autogen/bind_tld_zonefile
diff options
context:
space:
mode:
authorNick <nick@somerandomnick.ano>2010-04-18 21:29:21 +0000
committerNick <nick@somerandomnick.ano>2010-04-18 21:29:21 +0000
commit7aecea956f9cc701728d009e113b88d76bb7d19c (patch)
tree1a020f391475d54bac781ec0e1f2b15349752702 /scripts/nameserver_autogen/bind_tld_zonefile
parent288b4dec2ea9e137f332ad82a280293d0161c3bc (diff)
downloadresdb-7aecea956f9cc701728d009e113b88d76bb7d19c.tar.gz
resdb-7aecea956f9cc701728d009e113b88d76bb7d19c.zip
added a script from UFO to autogenerate a bind TLD zonefile
Diffstat (limited to 'scripts/nameserver_autogen/bind_tld_zonefile')
-rw-r--r--scripts/nameserver_autogen/bind_tld_zonefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile b/scripts/nameserver_autogen/bind_tld_zonefile
new file mode 100644
index 0000000..7710850
--- /dev/null
+++ b/scripts/nameserver_autogen/bind_tld_zonefile
@@ -0,0 +1,18 @@
+<?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;
+ print($name.' IN NS '.$server."\n");
+ $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES |
+ FILE_SKIP_EMPTY_LINES);
+ foreach ($ips as $ip) {
+ print($server.' IN A '.$ip."\n");
+ }
+ }
+}
+?>