|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 189 article |
2003-05-17 05:59:42 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
±¹³»¸Á nslookup üũ ½ºÅ©¸³Æ® |
|
|
#!/bin/bash
clear
if [ $(echo $1|sed -n -e '/\./p') ] ;then
host=$1.
else
host=$1
fi
echo "DNS HOST LOOKUP °á°ú ----------------"
echo
local=$(nslookup -timeout=1 $host|egrep -i "(Server:|Name:|Address:)")
echo "ºñ´©³Ý ---";echo "^[[1;33;40m$local^[[0m"
echo
be=$(nslookup -timeout=1 $host ns.bora.net 2>&1|grep -c "Non-existent")
if (( $be > 0 ));then
echo ">>> ÇØ´ç µµ¸ÞÀÎÀº Dns Host Lookup °á°ú°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù."
echo -n "### Whois Á¶È¸¸¦ ÇϽðڽÀ´Ï±î? [Y/n] : "
read whoisok ; [ ! $whoisok ] && whoisok=y
if [ $whoisok = "y" ] || [ $whoisok = "Y" ];then
whois $host
fi
#exit 0
fi
kdns=$(nslookup -timeout=1 $host kns.kornet.net|egrep -i "(Server:|Name:|Address:)")
thrunet=$(nslookup -timeout=1 $host ns.korea.com|egrep -i "(Server:|Name:|Address:)")
hanaro=$(nslookup -timeout=1 $host qns1.hananet.net|egrep -i "(Server:|Name:|Address:)")
dacom=$(nslookup -timeout=1 $host ns.bora.net|egrep -i "(Server:|Name:|Address:)")
echo "ÄÚ ³Ý ---";echo "^[[1;36;40m$kdns^[[0m"
echo
echo "µÎ·ç³Ý ---";echo "^[[1;33;40m$thrunet^[[0m"
echo
echo "Çϳª·Î ---";echo "^[[1;36;40m$hanaro^[[0m"
echo
echo "µ¥ÀÌÄÞ ---";echo "^[[1;33;40m$dacom^[[0m"
echo
serversetip=$(echo "$local"|grep "Address:"|tail -1|awk '{print $2}')
kdnssetip=$(echo "$kdns"|grep "Address:"|tail -1|awk '{print $2}')
if (( $be == 0 )) && [ ! $serversetip = $kdnssetip ];then
echo;echo ">>> ÇöÀç ¼¹ö ¼³Á¤ Lookup IP ¿Í Kornet Lookup IP °¡ ´Ù¸¨´Ï´Ù."
echo -n "### Whois Á¶È¸¸¦ ÇϽðڽÀ´Ï±î? [Y/n] : "
read whoisok ; [ ! $whoisok ] && whoisok=y
if [ $whoisok = "y" ] || [ $whoisok = "Y" ];then
whois $host
fi
fi
|
|
Page Loading [ 0.03 Sec ]
SQL Time [ 0 Sec ]
|
|
|