Revision [489]
This is an old revision of dotFreeStatus made by AvoYager on 2007-07-19 13:33:10.
Tue Mar 9 05:24:56 EST 2010
free is mastered by ns21.opennic.glue. ;; datestamped 1268127001
reply is mastered by from unexpected datestamped 1268127001
source: is mastered by 58.6.115.42#53, expected datestamped 1268127001
82.229.244.191#53 is mastered by datestamped 1268127001
Responding Hosts
Sun Jul 31 05:40:31 UTC 2011
All Hosts
Sun Jul 31 05:40:01 UTC 2011
The Script
#!/bin/bash
# file: audit.sh
# Modifications
# avo 20 Sep 2007 (Original author)
# BrianKoontz 01Jun2009 (Modified zone list)
#zone_list=`dig +norecurse +short tlds.opennic.glue txt |sed s/\"//g |cut -d" " -f3-`
#zone_list=${zone_list//fur/}
#zone_list=${zone_list//oss/}
#zone=
zone="opennic.glue bbs free fur geek indy ing null oss parody gopher"
zone_list=${zone}
############################
audit () {
test -e ${outfile}.log && mv -f ${outfile}.log ${outfile}.last
date >${outfile}.log
for each in `dig axfr ${zone} @58.6.115.46 |grep IN |cut -f1 |sort |uniq`
do echo "$each `host -W1 -ta $each`" |head -1 >> ${outfile}.log
done
test -e ${outfile}.last && diff ${outfile}.last ${outfile}.log > ${outfile}.diff
}
############################
summarize () {
sumfile=${zone}-summary
test -e ${sumfile}.log && mv -f ${sumfile}.log ${sumfile}.last
date >${sumfile}.log
grep "\.${zone}\..*has address" ${outfile}.log |cut -d " " -f 2-5 |sort >> ${sumfile}.log
grep "\.${zone}\..*has address" ${outfile}.log |sed s/^.*address.// |sort |uniq > ips.log
for each in `cat ips.log`
do
echo -n "$each ping:" >> ${sumfile}.log
if ping -c1 -q -W1 $each >/dev/null
then echo yes >> ${sumfile}.log
else echo no >> ${sumfile}.log
fi
done
rm ips.log
test -e ${sumfile}.last && diff ${sumfile}.last ${sumfile}.log > ${sumfile}.diff
}
############################
sumfails () {
failfile=${zone}-fail
date >${failfile}.log
grep "\(timed out\)\|\(SERVFAIL\)" ${outfile}.log |sort > ${failfile}.log
}
############################
build_links () {
linkfile=${zone}-links.html
droplist="ns mail dns. localhost"
passes () {
for each in $droplist
do expr "$link" : "$each" >/dev/null && return 1
done
return 0
}
linklist=`grep " has address " ${zone}-summary.log | cut -d" " -f1`
dstamp=`date`
cat >$linkfile
$zone links
${dstamp}
required: www.opennic.${zone}
EOF
for link in $linklist
do
if passes $link
then echo " $link " >>$linkfile
fi
done
cat >>$linkfile
CNAMEs not shown
EOF
}
############################
for zone in $zone_list
do \
outfile=${zone}-audit
audit
summarize
sumfails
build_links
done
exit 0
CategoryAuditing
CategoryHostmastering