summaryrefslogtreecommitdiff
path: root/scripts/nameserver_autogen/bind_tld_zonefile_all.sh
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.ano>2017-03-09 23:58:05 +0000
committerepoch <epoch@hacking.allowed.ano>2017-03-09 23:58:06 +0000
commita2574d61d6df5a652e3ef136a0a5d70d764af711 (patch)
treec4cb532df758aa4cda0539c27a99e672c64d6519 /scripts/nameserver_autogen/bind_tld_zonefile_all.sh
parentbce2a14ea9e2145e7ef28725b3572321188e8ee9 (diff)
downloadresdb-a2574d61d6df5a652e3ef136a0a5d70d764af711.tar.gz
resdb-a2574d61d6df5a652e3ef136a0a5d70d764af711.zip
updated the bind_tld_zonefile_all.sh for 21.0.0.0/8
Diffstat (limited to 'scripts/nameserver_autogen/bind_tld_zonefile_all.sh')
-rwxr-xr-xscripts/nameserver_autogen/bind_tld_zonefile_all.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/nameserver_autogen/bind_tld_zonefile_all.sh b/scripts/nameserver_autogen/bind_tld_zonefile_all.sh
index f49afe5..ccf0a3a 100755
--- a/scripts/nameserver_autogen/bind_tld_zonefile_all.sh
+++ b/scripts/nameserver_autogen/bind_tld_zonefile_all.sh
@@ -2,11 +2,8 @@
#made for bash. not sure if all /bin/sh work.
#be sure to edit these variables first.
-#zonefiles are named after the TLD they're for.
-#make sure not to clobber any files. ;)
-
#ZONEFILE_DIR=/etc/namedb
-#RDNS_ZONEFILE=/etc/namedb/1.in-addr.arpa
+RDNS_ZONEFILE=/etc/namedb/21.in-addr.arpa
#RESDB_PATH=/var/db/resdb
if [ ! "$ZONEFILE_DIR" ];then
@@ -15,7 +12,7 @@ if [ ! "$ZONEFILE_DIR" ];then
fi
-echo -n "generating ipv4 reverse lookup zonefile for 1/8..."
+echo -n "generating ipv4 reverse lookup zonefile for 21/8..."
echo "; this zonefile genreated on: `date`" > "$RDNS_ZONEFILE"
echo '$TTL 3600' >> "$RDNS_ZONEFILE"
@@ -23,7 +20,7 @@ echo '@ IN SOA @ root ('`date +" %Y%m%d%H"`' 60 300 3600000 3600 )' >> "$RDNS_ZO
echo '@ IN NS @' >> "$RDNS_ZONEFILE"
echo '@ IN A 127.0.0.1' >> "$RDNS_ZONEFILE"
-for i in `ls ${RESDB_PATH}/db/ip/01/*/*/ns/*`;do
+for i in `ls ${RESDB_PATH}/db/ip/15/*/*/ns/*`;do #this is for 21.
f=$(basename $i)
a=$(basename $(dirname $i))
b=$(basename $(dirname $(dirname $i)))
@@ -55,11 +52,11 @@ for GOHERE in ${RESDB_PATH}/db/dom/*;do
fi
fqserver=`cut -d/ -f3- <<< $server`
echo -e "${name}\tIN NS\t${fqserver}."
- for ip in `cat ${server}`;do
+ for ip in $(cat ${server});do
if grep ':' <<< "$ip" > /dev/null;then
- echo -e "${fqserver}.\tIN AAAA\t$ip"
+ printf '%s.\tIN AAAA\t%s\n' "${fqserver}" "${ip}"
else
- echo -e "${fqserver}.\tIN A\t$ip"
+ printf '%s.\tIN A\t%s\n' "${fqserver}" "${ip}"
fi
done
done