Created
June 3, 2015 19:49
-
-
Save kanazux/69090d2ed95a7e00401a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| sites="/root/url_list" | |
| fdnss="/root/fdnss" | |
| [ -f $fdnss ] && /bin/rm $fdnss | |
| dnss=`cat /etc/resolv.conf | egrep '^nameserver' | egrep -v '127.0.0.1|8.8.8.8' | awk '{print $2}' | sort -u >> /root/fdnss` | |
| for site in `cat $sites`; do | |
| g_dns=`dig +short $site 8.8.8.8 | head -1` | |
| for dns in `cat $fdnss`; do | |
| s_dns=`dig +short +tries=1 +time=3 $site $dns | head -1` | |
| if [ "$g_dns" != "$s_dns" ]; then | |
| echo "$site no $dns NOT ok" | |
| echo "ip $g_dns - ip $s_dns" | |
| else | |
| echo "$site no $dns ok" | |
| fi | |
| done | |
| echo "" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment