Skip to content

Instantly share code, notes, and snippets.

@kurobeats
Created May 19, 2017 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurobeats/4d481e10d6086dadb3c2b28528e19ea6 to your computer and use it in GitHub Desktop.
Save kurobeats/4d481e10d6086dadb3c2b28528e19ea6 to your computer and use it in GitHub Desktop.
whois but pretty
###### show Url information
function url-info()
{
doms=$@
if [ $# -eq 0 ]; then
echo -e "No domain given\nTry $0 domain.com domain2.org anyotherdomain.net"
fi
for i in $doms; do
_ip=$(host $i|grep 'has address'|awk {'print $4'})
if [ "$_ip" == "" ]; then
echo -e "\nERROR: $i DNS error or not a valid domain\n"
continue
fi
ip=`echo ${_ip[*]}|tr " " "|"`
echo -e "\nInformation for domain: $i [ $ip ]\nQuerying individual IPs"
for j in ${_ip[*]}; do
echo -e "\n$j results:"
whois $j |egrep -w 'OrgName:|City:|Country:|OriginAS:|NetRange:'
done
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment