#!/bin/bash
IP="213.239.249.194"
DOMAINS="meinungsverstaerker.de donnergurgler.net busn.org l33t.de intoxicatedmind.net \
	cssun.de eliteministerium.de laechelpenis.de frahi.de informationoverflow.net"
NS=( local 213.239.249.194 213.133.125.100 212.114.152.1 145.253.2.11 131.188.30.106 213.167.167.153 )
NS_DESC=( local ns.meinungsverstaerker.de ns2.satanix.de NEFkom Arcor Uni bnbt.de )
WHITE="\E[37;20m"
RED="\E[31;20m"
BLUE="\E[34;20m"

for i in $(seq 0 $((${#NS[@]} - 1)))
do
	if [ ${NS[$i]} == "local" ] ; then
		echo "Nameserver: (local default)"
		ns=""
	else
		echo "Nameserver: ${NS[$i]} (${NS_DESC[$i]})"
		ns=${NS[$i]}
	fi
	for domain in $DOMAINS
	do
		if host $domain $ns | grep "has address" | grep "$IP" > /dev/null ; then
			echo -e "\t${BLUE}$domain ${WHITE}korrekt aufgelöst zu ${BLUE}$IP"
		else
			echo -e "\t${RED}FEHLER! ${BLUE}$domain ${WHITE}konnte nicht auflöst werden!"
		fi
		tput sgr0	# reset colors
	done
done

