Whois Information Query Issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Whois Information Query Issue

Post by kendall »

Hello,

the following is code that i developed a while now that searches whois databases for domain records of a domain if unavailable

Code: Select all

// declare look up servers variables
$TLDservers = array("com"=>"whois.networksolutions.com","net"=>"whois.nsiregistry.net","org"=>"whois.networksolutions.com","info"=>"whois.afilias.info","biz"=>"whois.neulevel.biz");

//whois query
function LOOK_UP($server = false,$domain,$record = false){
	// if look up record only
	if($record == true){
		//look up domain records
		$record = checkdnsrr($domain);
		return $record;
	}else{
		// look up domain registrants	
		$port = '43';
		$fp = fsockopen($server,$port,&$errno,&$errstr,30);
		if(!$fp){
			return false;
		}else{
			fputs($fp, "$domain\r\n");
				while(!feof($fp)) {
               	 $data .= fgets($fp,128);	
            	}
       		 fclose($fp);
		}
		//echo $data;
		if($data != false)
			return strstr($data,'Domain Name');
		else
			return false;
	}
}
Now it used to work fine but lately i note that my searches for domains that are already taken are showing up as available.

now note the
if($data != false){return strstr($data,'Domain Name'); }
When the records of a domain name came back i searched from where the Domain Information starts and return this....Now I am receiving the information but there seems to be no instance of 'Domain Name' hence why my searches are coming up incorrectly.

in one instance i note i get a
server busy try again...
not sure what it means by that (except the obvious) but can anyone offer a better solution for me here....

is there a mother of all whois databases that i can you that can make my searches more accurate?

Kendall
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Was looking for whois info.

It seems whois.networksolutions.com does not return all .com entries - only those that were registered under networksolutions.
Take for example http://dnsstuff.com/tools/whois.ch?ip=xxx.com
It says "I was referred to whois.opensrs.net; I'm looking it up there."

How do I get the info - need to refer to this registrar ?
How do we know where to refer to ?

And checkdnsrr() is giving Fatal error: Call to undefined function checkdnsrr() in Windows but works in Linux.
Post Reply