[PHP] Domain Name Lookup Scripts

2004-05-18 Thread Ryan Schefke
Can anyone suggest any good (free) domain name lookup scripts written in
php?

 

Thanks,

Ryan



Re: [PHP] Domain Name Lookup Scripts

2004-05-18 Thread Robert Cummings
On Tue, 2004-05-18 at 11:09, Ryan Schefke wrote:
 Can anyone suggest any good (free) domain name lookup scripts written in
 php?

This is short, far from perfect, but I use it to look for availability
and you might be able to adapt it - it also checks for a verisign hit
which is usually that stupid thing they did a while back where NXDOMAINs
were overriden and returned as advertising spam:

#!/usr/bin/php -qC
?

if( !isset( $GLOBALS['argv'][1] ) )
{
echo 'Please supply a domain name!'.\n;
exit();  
}
 
$domain = trim( $GLOBALS['argv'][1] );

$extensions = array
(
'com',
'org',
'net',
'biz',
'ca ',
);

foreach( $extensions as $ext )
{
$cdomain = $domain.'.'.$ext;
$output = `host $cdomain`;  
  
if( eregi( '64\.94\.110\.11', $output )
|| 
eregi( 'NXDOMAIN', $output ) )
{ 
echo $cdomain.' -- free'.\n;
} 
else
{   
echo $cdomain.' -- taken'.\n;
}  
}

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php