Computing.Net > Forums > Web Development > querying a whois server

querying a whois server

Reply to Message Icon

Original Message
Name: Laler
Date: May 23, 2006 at 08:56:54 Pacific
Subject: querying a whois server
OS: xp
CPU/Ram: 2800 512
Model/Manufacturer: generic
Comment:

Hi,

if we query a whois server to check for a domain name, is there a sure way to get only the domain availability status? some server says 'not found', other say 'no info', etc., which makes me ends up on creating long line of codes to check for just the domain availability.

here's the code I use (PHP):

$handle = fsockopen ('whois-servers.net', 43);
fputs ($handle, 'computing.net' . "\r\n");
$result = '';
while (!feof ($handle)){ $result .= fgets ($handle, 128); }
fclose ($handle);

// [work with $result here]


-----

And then I get another idea, I just count the result line. If it's more than 25 then there're some data written (not just 'no info' notification) which means it's no longer available :D Is this ok?

Or, am I doing it all wrong from the beginning? (is there a 'correct' way to do it other than querying a whois server?)

---
Site of the Day


Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: querying a whois server

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge