Jan 29, 2009
admin

Domain Name Availability Checker PHP Script

Hello Friends. Yesterday when i was surfing, i found one very useful PHP Script named Domain Name Availability Chacker.

Domain Name availability Chacker Script is very easy to install if your server is PHP enabled. This script is very simple to use. The domain name availability checker also checks bulk domain names in just a single click.

Just input the desired domain name in the text box and click “check domain availability” button to get the results on the fly.

You have to just copy this script then paste it and run this PHP script.

PHP Script is Shown below :

<?php
error_reporting(0);
set_time_limit(0);
ob_start();

$ext = array(
‘.com’       => array(‘whois.crsnic.net’,'No match for’),
‘.net’       => array(‘whois.crsnic.net’,'No match for’),
‘.biz’       => array(‘whois.biz’,'Not found’),
‘.mobi’      => array(‘whois.dotmobiregistry.net’, ‘NOT FOUND’),
‘.tv’       => array(‘whois.nic.tv’, ‘No match for’),
‘.in’       => array(‘whois.inregistry.net’, ‘NOT FOUND’),
‘.info’    => array(‘whois.afilias.net’,'NOT FOUND’),
‘.co.uk’    => array(‘whois.nic.uk’,'No match’),
‘.co.ug’    => array(‘wawa.eahd.or.ug’,'No entries found’),
‘.or.ug’    => array(‘wawa.eahd.or.ug’,'No entries found’),
‘.nl’       => array(‘whois.domain-registry.nl’,'not a registered domain’),
‘.ro’       => array(‘whois.rotld.ro’,'No entries found for the selected’),
‘.com.au’   => array(‘whois.ausregistry.net.au’,'No data Found’),
‘.ca’       => array(‘whois.cira.ca’, ‘AVAIL’),
‘.org.uk’   => array(‘whois.nic.uk’,'No match’),
‘.name’    => array(‘whois.nic.name’,'No match’),
‘.us’       => array(‘whois.nic.us’,'Not Found’),
‘.ac.ug’    => array(‘wawa.eahd.or.ug’,'No entries found’),
‘.ne.ug’    => array(‘wawa.eahd.or.ug’,'No entries found’),
‘.sc.ug’    => array(‘wawa.eahd.or.ug’,'No entries found’),
‘.ws’      => array(‘whois.website.ws’,'No Match’),
‘.be’       => array(‘whois.ripe.net’,'No entries’),
‘.com.cn’    => array(‘whois.cnnic.cn’,'no matching record’),
‘.net.cn’    => array(‘whois.cnnic.cn’,'no matching record’),
‘.org.cn’    => array(‘whois.cnnic.cn’,'no matching record’),
‘.no’      => array(‘whois.norid.no’,'no matches’),
‘.se’       => array(‘whois.nic-se.se’,'No data found’),
‘.nu’       => array(‘whois.nic.nu’,'NO MATCH for’),
‘.com.tw’    => array(‘whois.twnic.net’,'No such Domain Name’),
‘.net.tw’    => array(‘whois.twnic.net’,'No such Domain Name’),
‘.org.tw’    => array(‘whois.twnic.net’,'No such Domain Name’),
‘.cc’       => array(‘whois.nic.cc’,'No match’),
‘.nl’       => array(‘whois.domain-registry.nl’,'is free’),
‘.pl’       => array(‘whois.dns.pl’,'No information about’),
‘.pt’       => array(‘whois.dns.pt’,'No match’)
);
function return_status($domain, $status)
{
global $extension;
$domain = trim($domain);
$wt = ($status == ‘available’) ? ‘bold’ : ‘normal’;
if($status == ‘invalid’ && $extension == ‘org’) { $status .= ‘ (.org WHOIS prevents request)’; }

echo “<div style=\”font-weight:$wt\”>$domain is $status!</div>”;
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Domain Name Availability Checker</title>
</head>
<body>
<table width=”75%” border=”0″ align=”center” cellpadding=”5″ cellspacing=”1″>
<tr>
<td height=”30″ align=”center”><h2>Domain Name Availability Checker</h2></td>
</tr>
<tr>
<td align=”center”><form action=”" method=”post” name=”frmsearchposition” class=”frmstyle” id=”frmsearchposition”>
<table width=”100%”   border=”0″ cellspacing=”1″ cellpadding=”3″>
<tr align=”left”>
<td width=”20%” align=”left” valign=”middle”>Enter Domains – 1 per line. (Ex: google.com) </td>
<td width=”40%”><textarea name=”domains” cols=”55″ rows=”8″ class=”frmelements_ta” id=”domains”><?=$sUrl?>
</textarea></td>
<td><input type=”submit” name=”Submit” value=”Check Domain Availability” /></td>
</tr>
</table>
</form></td>
</tr>

<tr>
<td width=”70%” align=”center” valign=”top”>
<table width=”100%” border=”0″ align=”center” cellpadding=”3″ cellspacing=”1″>
<tr>
<td align=”center”><h2>Domain Name Availability Report</h2></td>
</tr>
<tr>
<td align=”left” class=”tbl_texttd”><table width=”740″   border=”0″ cellspacing=”0″ cellpadding=”2″>
<tr>
<td align=”left”><?
if(strlen($_POST['domains']) > 0)
{
$domains = explode(“\n”, $_POST['domains']);
echo ‘<h2>Checking ‘ . count($domains) . ‘ domains</h2><br />’;
echo (isset($_POST['save'])) ? ‘Processing results, Please wait…<br /><br />’ : null;

foreach($domains as $domain)
{
unset($buffer);
preg_match(‘@^(http://www\.|http://|www\.)?([^/]+)@i’, $domain, $matches);
$domain = $matches[2];

$tld = explode(‘.’, $domain, 2);
$extension = strtolower(trim($tld[1]));

if(strlen($domain) > 0 && array_key_exists(‘.’ . $extension, $ext))
{
$server = $ext['.' .$extension][0];

$sock = fsockopen($server, 43) or die(‘Error Connecting To Server:’ . $server);
fputs($sock, “$domain\r\n”);

while( !feof($sock) )
{
$buffer .= fgets($sock,128);
}

fclose($sock);
if($extension == ‘org’) echo nl2br($buffer);

if(eregi($ext['.' . $extension][1], $buffer)) { return_status($domain, ‘available’); }

else { return_status($domain, ‘taken’); }
}
else
{
if(strlen($domain) > 0)    { return_status($domain, ‘invalid’); }
}

ob_flush();
flush();
sleep(0.1);
}

}
else
{
echo ‘Please enter one or more domains!’;
}
?>
<div class=”div”></div></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

If you like my Post then please comment on this.

  • http://www.eplantscience.com/ Mustafa Contractor

    Thank you so much….
    After an intensive search finally i got what i was looking for :)
    God Bless You

  • http://www.eplantscience.com/ Mustafa Contractor

    Thank you so much….
    After an intensive search finally i got what i was looking for :)
    God Bless You

  • http://bnbharat.com/ senthil

    Hey,

    You are really genious, i was trying to find this script in all the places, your script is working perfectly.
    I am going to use your script to my site http://www.bnbharat.com for service purpose.

    Thanks
    Senthil

  • http://bnbharat.com senthil

    Hey,

    You are really genious, i was trying to find this script in all the places, your script is working perfectly.
    I am going to use your script to my site http://www.bnbharat.com for service purpose.

    Thanks
    Senthil

  • http://www.domainhostlowprice.com John

    Looks nice.
    Useful Script.

  • Anonymous

    Hey,

    Can you do me one favour ? Can you add my link on your site. I will also place your link on my site.
    Please reply .

    Thanks.
    phpgenious.com

  • Guest

    Yar it’s not working on my site

  • http://tracking.cpahail.com/aff_c?offer_id=1383&aff_id=343 Lashunda Gatts
  • Hansie8888

    this script is not working error in line 7

  • Mitrabinda Jvmba

    Excellent code. Guys please recreate the ‘ and ” in the code after copying and remove all   then the code will workhttp://www.flashvend.net

  • dancenation

    Hello i wish this code works but its not working :)iS IT POSSIble someone to tell me the fix so it can make it work thanks //mail me if you can help mitko.hristov{at}gmail{dot}com

  • Mandy

    Did you get this one to work?? its is also not working on my site

  • swapnali

    I have some problem i removed 
    Â but its still not working… I like your code too good. can you send me rite code on swapnalirasam1988@gmail.com

  • Giannis

    Don’t work! Parse error: syntax error, unexpected T_STRING, expecting ‘)’ on line 7

  • Chhabindra

    thanx

  • Jas

    Love this script! Thank you. Opened it in Notepad++ and just like one guy said before me – searched for and removed all of the Â’s; updated all of the ‘ and ” and it’s all working. Thanks again.

  • kiran zaware

    if i search domain ant it is already registered then i want to suggest another extention of that name domain wich is available

  • http://www.mais.co.mz/ Rui André Durão

    I tried this on Joomla and it did not work!

  • guest

    Then fix it, not that hard.

  • Sankhadip C.

    Good Script. Thanks

  • ricky

    it is Not working , it is saying error on line Number 7

Support to grow

If you think my post is helps you then please make donation and do support to grow:

PHP Genious Services

I am a PHP freelancer india, PHP Developer india, PHP programmer india, Wordpress Freelancer india, Wordpress customization services, Wordpress Plugin Developer, Wordpress theme customization, Wordpress plugin customization, Magento Freelancer, Magento Developer india, Magento customization services, Magento theme integration, Opencart Developer india, Zencart Freelancer, Opencart customization, Opencart plugin development, HTML and CSS customization, cakePHP Developer, cakePHP Freelancer india, Ecommerce Developer india

Click Here for

Follow me on Facebook

Categories

Get Adobe Flash player