Bulk Domains Lookup


So many domains…

Recently I was given a list of around 100 domains to check the status of, e.i. Registrar Name, Expiration etc…
I sat down with my WHOIS site of choice and started working through the list. After not even completing the first one I thought, there must be a better way.

I’m on a windows machine currently…

First issue, No cmd line whois

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

'whosi' is not recognized as an internal or external command,
operable program or batch file.

After 30 seconds on google, Sysinternals saves the day


Whois v1.14 - Domain information lookup
Copyright (C) 2005-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

Usage: whois [-v] domainname [whois.server]
 -v   Print whois information for referrals
      Do not display the startup banner and copyright message.

Collecting Infomation

This simple oneliner gave me a directory full of text files of WHOIS information, one file for each line in the domains.txt file.
A lot of whois server do not like you hitting them repeatedly and with out delay, so a 15 second time out was added before each look up.




for /F "tokens=*" %%A in (domains.txt) do (timeout 15 & whois -v %%A > out\%%A.txt)


Directory of C:\Sandbox\whois\out

13/10/2016  12:07 PM             <DIR> .
13/10/2016  12:07 PM             <DIR> ..
13/10/2016  12:08 PM             2,637 carleebowles.com.txt
13/10/2016  12:08 PM             1,827 chrischase.name.txt
13/10/2016  12:08 PM             6,337 sirmonkeys.com.txt
               3 File(s)         10,801 bytes
               2 Dir(s)  451,512,074,240 bytes free

Making sense

To clean things up I knocked up a simple PHP script (report.php) to get the information I needed out. I doubt it covers everything, but it was enough for what I needed.
It takes each of the .txt files, does some bad Regex and spits out a somewhat useful CSV report.

C:\Sandbox\whois>php report.php


carleebowles.com.txt,carleebowles.com,"gandi sas",2017-02-16
chrischase.name.txt,chrischase.name,"gandi sas",
sirmonkeys.com.txt,sirmonkeys.com,"gandi sas",2017-07-26

Is it perfect, no but it will do for now.


About Chris Chase 17 Articles
Yeah i could write something here... but no that's not going to happen.

Be the first to comment

Leave a Reply

Your email address will not be published.