Thought this might be useful to someone, so I'm releasing it into the wild! It creates a database that looks like this:

Mod's: this is completely above-board... WHOIS is provided by InterNIC via port 43 for unlimited free lookups.
Enjoy!
CREATE TABLE `domains` ( `domain` varchar(6) NOT NULL, `len` tinyint(1) unsigned NOT NULL, `available` tinyint(1) unsigned NOT NULL, `expires` date NOT NULL, `checked` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`domain`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
<?php
set_time_limit(0);
$dbhost = 'localhost';
$dbuser = 'foo';
$dbpass = 'bar';
$dbname = 'whois';
$dh = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);
for($i = 'aaa'; $i <= 'zzzz'; $i++)
{
$len = strlen($i);
if($conn = fsockopen ('whois.internic.net', 43))
{
$output = NULL;
fputs($conn, "domain $i.com\r\n");
while(!feof($conn))
{
$output .= fgets($conn, 128);
}
fclose($conn);
}
if(strpos($output, 'No match for domain') !== FALSE)
mysql_query("INSERT INTO `domains` VALUES ('$i', '$len', 1, '0000-00-00', NULL);") or die($i . ' - ' .mysql_error());
else
{
preg_match('/Expiration Date: (.+?)\n/', $output, $expires);
$expires = strtotime($expires[1]);
$expires = date('Y-m-d', $expires);
mysql_query("INSERT INTO `domains` VALUES ('$i', '$len', 0, '$expires', NULL);") or die($i . ' - ' .mysql_error());
}
}
mysql_close($dh);
?>






