nsbin/axfrs
Nico Schottelius 395eb2b3b1 script to create new mailinglist
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
2010-07-12 22:47:21 +02:00

38 lines
891 B
Text
Executable file

# 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"
for domain in "$@"; do
## 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