Whois Shell Script
March 8, 2008
I’ve got loads of little scripts that I’ve written lying around my hard drive. Some I’ve probably only used once and never looked at again, and others I use regularly. I thought I would post some of them here.
Here is a simple shell script that I wrote that performs a whois lookup of every domain name in a given file and outputs the registrant details:
#!/bin/bash
# usage: $0 <domains file>
domains=`cat $1`
for domain in $domains
do
stripped_domain=${domain#www.} # strip a leading www.
reg=`whois $stripped_domain | grep -i -A 1 registrant: | tail -n 1`
echo "[$domain] $reg"
done
Given an input file containing the following domains
www.dowling.me.uk www.google.com www.wordpress.com www.facebook.com
The script will output
[www.dowling.me.uk] B. Dowling [www.google.com] Google Inc. (DOM-258879) [www.wordpress.com] Matt Mullenweg [www.facebook.com] Facebook, Inc
Obviously this is one of those scripts that I used once and never looked at again!
[...] the whois shell script I posted recently the Python port scanner below is another script I’ve had lying around on my [...]
Pingback by Dowling.me.uk » Python Port Scanner — March 29, 2008 @ 10:59 pm
Hello, I was looking around for a while searching for port scaner and I happened upon this site and your post regarding Whois Shell Script, I will definitely this to my port scaner bookmarks!
Comment by Daniel Craig — June 26, 2008 @ 8:10 pm