Last active
October 16, 2019 15:32
-
-
Save hoangdh/f6a53c5ea2b32cf5e49091c9e4fc3dca to your computer and use it in GitHub Desktop.
Lấy IP thực của Domain đang trỏ về sử dụng DNS của Google.
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 | |
if [ -e $1 ] && [ ! $# -eq 0 ] | |
then | |
file=$1 | |
list=`cat $file` | |
for dom in $list | |
do | |
ip_real=`dig +time=5 +short $dom @8.8.8.8 | head -n1` | |
echo "$ip_real, $dom" | |
done | |
else | |
echo "File $1 doesn't exist." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sử dụng: