Bulk domain availability checker script

Pure php based domain availability checker script. This script can check domain availability without whois lookup. And supports all TLDs over internet

How it works?

Each registered domain has its own ns (name server) entry. Which can be checked using dns_get_record() function. In this script we check whether queried domain has it ns entry or not if we found it then it is not available.

PHP function to check domain availability

function domain_availability($domains){
foreach ($domains as $domain) 
{
	$ns=  @dns_get_record($domain,DNS_NS);
	if(count($ns))
	{
	$rs[$domain]=0;
	}
	else 
	{
	$rs[$domain]=1;
	}
}
return $rs;
}

Uses

array domain_availability(array $domainlist)

function takes array of domains as parameter and returns array which has domain name as key and value ( 1 for available and 0 for not available )

Example

  $domains=array("google.com","hsghjgsy.org","jsdhjs.es","aajjks.eu","sjdjsd.in");
  $rs=domain_availability($domains);
  print_r($rs);

Output


Array
(
[google.com] => 0
[hsghjgsy.org] => 1
[jsdhjs.es] => 1
[aajjks.eu] => 1
[sjdjsd.in] => 1
)

Published by Sunny

A Mechanical engineer by education and web developer by passion and profession. He lives in Lucknow, India. Currently earning his livings by hitting keyboad. ;)

Join the Conversation

4 Comments

Leave a comment

Your email address will not be published. Required fields are marked *