The following steps to know the ip address,owener of the domain name,etc .
1. Type the following command in terminal and open the empty text file
sudo gedit ipad.sh
Copy and paste the following lines in the text file ipad.sh then save and exit
#!/bin/bash
# A sample shell script to print domain ip address hosting information such as
# Location of server, city, ip address owner, country and network range.
# This is useful to track spammers or research purpose.
# -------------------------------------------------------------------------
# Get all domains
_dom=$@
# Die if no domains are given
[ $# -eq 0 ] && { echo "Usage: $0 domain1.com domain2.com ..."; exit 1; }
for d in $_dom
do
_ip=$(host $d | grep 'has add' | head -1 | awk '{ print $4}')
[ "$_ip" == "" ] && { echo "Error: $d is not valid domain or dns error."; continue; }
echo "Getting information for domain: $d [ $_ip ]..."
whois "$_ip" | egrep -w 'OrgName:|City:|Country:|OriginAS:|NetRange:'
echo ""
done
Then make the text file as executable file.
sudo chmod +x ipad.sh
Next execute the script 'ipad.sh'
./ipad.sh
Thursday, May 13, 2010
Subscribe to:
Post Comments (Atom)
1 comments:
Dude! This is the coolest script in the world. Thank you for this. Shell scripting is such a great thing. Now I don't have to tinker with my firewall just to find the IP of a domain name!
Post a Comment