1 Star 0 Fork 0

Jerry/domain2IP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
getIP.sh 784 Bytes
一键复制 编辑 原始数据 按行查看 历史
winway 提交于 2018-06-13 16:54 . first commit
#! /bin/bash
#
CONFDIR=./conf/
RESULTDIR=./result/
if [[ $# -ne 1 ]]
then
echo "Usage: sh $0 <url>"
exit
fi
url=$1
nameservers=($(cat ${CONFDIR}/nameservers.txt | grep '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | sort -u))
N=300
ts=$(date '+%s')
for dns_server in ${nameservers[*]}
do
{ dig -t AAAA +noquestion +noadditional +noauthority @$dns_server $url | awk '/IN[ \t]+AAAA/{print $NF}' > /tmp/.${url}.${ts}.${dns_server}.txt; echo "dig @$dns_server $url done"; } &
joblist=($(jobs -p))
while (( ${#joblist[*]} > $N ))
do
echo "######## rest for a while ########"
sleep 0.1
joblist=($(jobs -p))
done
done
wait
cat /tmp/.${url}.${ts}.*.txt | sort -u >${RESULTDIR}/${url}.ip.txt
find /tmp/ -name ".${url}.${ts}.*.txt" | xargs rm -f
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/github-22268501/domain2IP.git
git@gitee.com:github-22268501/domain2IP.git
github-22268501
domain2IP
domain2IP
master

搜索帮助