2006-07-20 07:54:37 +00:00
|
|
|
|
|
|
|
# Date: 15. February 2002
|
|
|
|
# Author: Nico Schottelius <nico-linux@schottelius.(org|net)>
|
|
|
|
# Last Changed: same
|
|
|
|
# Version: 0.2
|
|
|
|
# Comment:
|
|
|
|
#
|
|
|
|
# 0.1: runs fine
|
|
|
|
# 0.2: uses awk, sed make some problems (with last NS expression)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo `basename $0`': domain(s)'
|
|
|
|
echo 'Hey, what domain to get?'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
DIG="dig"
|
|
|
|
EGREP="egrep"
|
|
|
|
GREP="grep"
|
|
|
|
SED="sed"
|
|
|
|
AWK="awk"
|
|
|
|
ECHO="echo"
|
|
|
|
|
2010-07-12 20:47:21 +00:00
|
|
|
for domain in "$@"; do
|
2006-07-20 07:54:37 +00:00
|
|
|
|
|
|
|
## NS_SERVERS=`$DIG $domain ns|$EGREP -i 'in.*ns'|$GREP -v '^;' | $SED 's/.*IN.*NS\(.*\)/\1/g' | sed 's/\.$//g'`
|
|
|
|
NS_SERVERS=`$DIG $domain ns|$EGREP -i 'in.*ns'|$GREP -v '^;' | $AWK '{ print $5} ' | sed 's/\.$//g'`
|
|
|
|
$ECHO "Servers: $NS_SERVERS"
|
|
|
|
|
|
|
|
for server in $NS_SERVERS; do
|
|
|
|
$ECHO "Quering $server for $domain ..."
|
|
|
|
$DIG @$server $domain axfr >> $domain-$server 2>&1
|
|
|
|
$ECHO "Done. Saved output to $domain-$server"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|