Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2004-03-18, 06:16 PM   #1
swedguy
Vagabond
 
swedguy's Avatar
 
Join Date: Aug 2003
Posts: 2,374
Send a message via ICQ to swedguy
Look up available domains - the easy way

I was just registering some domains. So I was doing "whois domain.com" way too many times to find domains that were available. Pain in the ass.

Here's a small little script that will make it easier for you.

Upload this little script to your server and name it "whois.sh"

PHP Code:
#!/bin/bash

if [ $# -lt 1 ]
then
        
echo "Usage:"
        
echo
        echo 
"`basename $0` <file>"
        
exit
fi

domains
=`cat $1`

for 
domain in $domains
do
    
sleep 2
    whois $domain 
grep "No match for"
done 
Change the permissions on the script "chmod 755 whois.sh".

Now upload a file with all the domains you want to check, 1 domain per line.

Run the script with "./whois.sh domains.txt" - or what ever you named the file with all the domains in. Now it will spit out all the domains that are available

EDIT: added a 2 second pause before each whois. They seem to boot you if you whois them too fast.

Last edited by swedguy; 2004-03-18 at 06:31 PM..
swedguy is offline   Reply With Quote
Old 2004-03-31, 05:21 AM   #2
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
here's a simple script that gets results of a networksolutions whois query.


save code in a file called whois.php and upload to your server.

usage: whois.php?domain=domain.com

PHP Code:
<?php 
if (trim($domain) <> "") {
   
$domain trim($domain);
   
$fp fsockopen("whois.networksolutions.com"43$errno$errstr30);
   if (!
$fp) {
     echo 
"$errstr ($errno)";
   } else {
     
fputs($fp"$domain\r\n");
     print 
"<pre>\r\n";
     while (!
feof($fp)) {
         echo 
fread($fp,128);
     }
     print 
"</pre>";
     
fclose ($fp);
   }
}
?>
Opti is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:46 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc