summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");
+ }
+ }
+}
+?>