Mercurial > hg > anonet-resdb
annotate scripts/nameserver_autogen/bind_tld_zonefile @ 1138:c95369b825a2 draft
whoisd... don't remember.
added ipv6 address for my nameserver
does anyone still use bind_tld_zonefile?
upgraded bind_tld_zonefile.sh to use ipv6 in one place and rDNS in another
author | epoch <epoch@hacking.allowed.org> |
---|---|
date | Sun, 06 Oct 2013 10:21:44 +0000 |
parents | c9b4cd6ac74e |
children |
rev | line source |
---|---|
11
2e7c94478881
forgot to make some important changes to bind_tld_zonefile generator
Nick <nick@somerandomnick.ano>
parents:
10
diff
changeset
|
1 #!/usr/bin/php |
1138
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
350
diff
changeset
|
2 #does anyone use this? |
10
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 <?php |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 print('$ttl 600'."\n"); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 chdir('../db/dom/ano'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 $names = scandir('./'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
7 foreach ($names as $name) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
8 if (!file_exists($name.'/ns/')) continue; |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
9 $servers = scandir($name.'/ns/'); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
10 foreach ($servers as $server) { |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 if ($server[0] == '.') continue; |
349
59102e1e06f9
Qualifying domain names in the bind generator script now
lex <lex@lynx.ano>
parents:
11
diff
changeset
|
12 if (substr($name, -4) == ".ano") $name .= "."; |
59102e1e06f9
Qualifying domain names in the bind generator script now
lex <lex@lynx.ano>
parents:
11
diff
changeset
|
13 $fqserver = $server; |
59102e1e06f9
Qualifying domain names in the bind generator script now
lex <lex@lynx.ano>
parents:
11
diff
changeset
|
14 if (substr($server, -4) == ".ano") $fqserver .= "."; |
59102e1e06f9
Qualifying domain names in the bind generator script now
lex <lex@lynx.ano>
parents:
11
diff
changeset
|
15 print($name.' IN NS '.$fqserver."\n"); |
10
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
16 $ips = file($name.'/ns/'.$server, FILE_IGNORE_NEW_LINES | |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
17 FILE_SKIP_EMPTY_LINES); |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
18 foreach ($ips as $ip) { |
349
59102e1e06f9
Qualifying domain names in the bind generator script now
lex <lex@lynx.ano>
parents:
11
diff
changeset
|
19 print($fqserver.' IN A '.$ip."\n"); |
10
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
20 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
21 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
22 } |
7e97054a5437
added a script from UFO to autogenerate a bind TLD zonefile
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
23 ?> |