diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/nameserver_autogen/bind_tld_zonefile_all.sh | 15 |
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 |