Mercurial > hg > anonet-resdb
diff scripts/nameserver_autogen/bind_tld_zonefile @ 10:7e97054a5437 draft
added a script from UFO to autogenerate a bind TLD zonefile
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Sun, 18 Apr 2010 21:29:21 +0000 |
parents | |
children | 2e7c94478881 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/nameserver_autogen/bind_tld_zonefile Sun Apr 18 21:29:21 2010 +0000 @@ -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"); + } + } +} +?>