• 幕客老师召集小伙伴
  • 运维高手36项修炼
  • python自动化运维项目实战
  • nginx从入门到实战
  • 阿里云与Centos7实战

通过shell脚本查看DNS的运营商解析地址

#!/bin/sh
#DNS server nslookup
Unicom=202.106.0.20
Telecom=219.141.136.10
#Telecom=203.196.0.6
Edu=121.194.2.2

case "$1" in
A)
echo "-----------------Unicom----------------------"
rndc flush
dig @${Unicom} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
echo "-----------------Telecom----------------------"
dig @${Telecom} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
rndc flush
echo "-----------------Edu----------------------"
dig @${Edu} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
rndc flush
;;
cname)
echo "-----------------Unicom----------------------"
dig @${Unicom} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
echo "-----------------Telecom----------------------"
dig @${Telecom} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
echo "-----------------Edu----------------------"
dig @${Edu} $2 +noadditional +noauthority +noquestion +nocmd +nostats|grep -v ';'
;;
dnsserver)
echo "-----------------Unicom----------------------"
dig @${Unicom} $2 +noanswer +noauthority +noquestion +nocmd +nostats|grep -v ';'
echo "-----------------Telecom----------------------"
dig @${Telecom} $2 +noanswer +noauthority +noquestion +nocmd +nostats|grep -v ';'
echo "-----------------Edu----------------------"
dig @${Edu} $2 +noanswer +noauthority +noquestion +nocmd +nostats|grep -v ';'
;;
*)
echo $"Usage: {A|cname|dnsserver}"
exit 1
esac

exit

通过shell脚本查看DNS的运营商解析地址

Pingbacks已打开。

引用地址

暂无评论

发表评论