Last active
December 10, 2015 18:58
-
-
Save fernandokosh/4478679 to your computer and use it in GitHub Desktop.
Simple script to check in DNS if a domain belongs to my server.
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/bash | |
### DNS server to check in whois result | |
server="ns1.mydomain.com" | |
### If will get by ls in folder | |
zones="/var/cache/bind/" | |
### One per line | |
zone_list="/var/cache/bind/domains.txt" | |
### Comment to use ls based | |
for domain in `cat $zone_list` | |
### Uncomment to use file list | |
#for domain in `ls $zones` | |
do | |
echo -n "Check whois info for $domain..." | |
if [ `whois $domain |grep -c -i $server` -gt 0 ] | |
then | |
echo ' OK' | |
else | |
echo ' Error'; | |
fi | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment