Commit 7ec0f82a authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve dns scripts

parent 21b20a44
#!/bin/sh
mkdir -p whois-cache
print_whois()
{
if [ ! -s "whois-cache/$1" ] ; then
sleep 1
if ! whois "$1" > "whois-cache/$1" ; then
echo "no WHOIS for $1" >&2
rm -f "whois-cache/$1"
return 1
fi
fi
cat "whois-cache/$1"
return
}
for i in /var/lib/bind/zone/* ; do
echo "$i" | egrep -q "(arpa|template|\.sh|\.common)" && continue
[ -d "$i" ] && continue
basename "$i" | egrep -q "(arpa|template|\.sh|\.common|^local|empty)" && continue
basename "$i" | egrep -q "(etersoft)" && continue
domain=$(basename "$i")
whois "$domain" | grep -q -i "ns[1|4].etersoft.ru" &>/dev/null && continue
print_whois "$domain" | grep -q -i "ns[1|4].etersoft.ru" &>/dev/null && continue
print_whois "$domain" | grep -q -i "ns[1|2].azbyka.ru" &>/dev/null && continue
echo "$domain left our"
sleep 1
done
#!/bin/sh
# https://www.nic.ru/manager/docs/partners/protocol/access_list_domains.shtml
passwd=$(cat /home/share/Внутренние/nic-passwd)
curl "https://www.nic.ru/downloads/domains.gz?login=7550/NIC-REG/adm&password=$passwd" | ercat > domains.tsv
curl "https://www.nic.ru/downloads/domains.gz?login=7550/NIC-REG/adm&password=$passwd" | gunzip > domains.tsv
#sort -k3.8 -k3.4 -k3.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment