Automate DNS Zone Transfer

dns host linux oscp security zonetransfer

/bin/bash #Simple zone transfer bash script with $1 being first argument given #Tested against #for example ./ if [ -z "$1" ];then echo "[] Simple Zone Transfer script" echo "[] Usage : $0 " exit 0 fi #if argument was given, identify DNS servers for domain. #For each of these servers, attempt a zone transfer for server in $(host -t ns $1 |cut -d" " -f4);do host -l $1 $server |grep "has addres" done

The author would love to hear your comments. Let us discuss at Twitter @qasimchadhar.