Omega Owners Forum

Chat Area => General Discussion Area => Topic started by: tunnie on 30 July 2008, 11:22:56

Title: sorry work releated question....
Post by: tunnie on 30 July 2008, 11:22:56
... does anyone know of a decent bulk IP whois lookup service?

I am going to have a huge list of gateways which i need to look up, to find the carrier they came from.

Last time it was limited numbers and i just did a manual request on linux box, but don't really wanna do that 200 times.
Title: Re: sorry work releated question....
Post by: PaulW on 30 July 2008, 11:35:36
you still have access to a linux box??  if so, export the IP addresses into a file (one per line), and then create the following bash script
whois_bulk.sh
Code: [Select]
#!/bin/bash
for i in `cat $1`
do
  whois $i > whois_$i
done

set the file to executable (chmod +x whois_bulk.sh) and then run it
./whois_bulk.sh inputiplist.txt

it will create a seperate whois for each IP address (whois_xx.xx.xx.xx), and so-on...
Title: Re: sorry work releated question....
Post by: PaulW on 30 July 2008, 11:38:27
also, if you want to stop the whois servers going haywire, after the line

whois $1 > $whois_$i

put

sleep 2

to make it wait 2 seconds (increase/decrease as required)

Also, if you want certain parts, grep the output (if you just want descr tags)

whois $1 | grep descr > $whois_$i

will return:

gsi ~ # whois 217.155.56.220 | grep descr
descr:        Mr Jaime Lett
descr:        ADSL
descr:        Zen Internet Ltd

(although i called that straight from console, the output will be the same in the result files)
Title: Re: sorry work releated question....
Post by: tunnie on 30 July 2008, 11:40:53
cheers, that looks like a neat way to do it.

Might have to put the sleep in there, most of our boxes are blacklisted from whois  ::)
Title: Re: sorry work releated question....
Post by: ians on 30 July 2008, 11:40:57
I think we need a foreign language sub forum ;)
Title: Re: sorry work releated question....
Post by: PaulW on 30 July 2008, 11:42:17
 :y
Title: Re: sorry work releated question....
Post by: tunnie on 30 July 2008, 11:44:50
Quote
I think we need a foreign language sub forum ;)

You mean a superior language sub forum?  ;)  ;D
Title: Re: sorry work releated question....
Post by: ians on 30 July 2008, 11:54:05
I can think of a number of adjectives but superior is not one of them ;) ;D