Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7

Thread: WHOIS checker?

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    Is it possible to make your own WHOIS checker (domain name checker) or is it like, really complicated? I would have thought it would have been done with PHP but I dunno.

    Thanks in advance, will7.
    Rednerve
    Creative Freelance Design

  2.  

  3. #2
    Senior Member ajaspers's Avatar
    Join Date
    Apr 2003
    Posts
    149
    Member #
    1150
    WHOIS is a very simple protocol. Connect to port 43 of the WHOIS server (whois.verisign-grs.com for .com/.net, whois.publicinterestregistry.net for .org), and write the domain name with a carriage return/line feed at the end.

    This is the function I wrote for use in my scripts:
    PHP Code:
    function whois($domain$server)
    {
            
    // connect to server
            
    if(!($fp = @fsockopen($server43)))
            {
                    return 
    false;
            }

            
    // write request
            
    fwrite($fp"$domain\r\n");

            
    // get response
            
    $data "";

            while(!
    feof($fp))
            {
                    
    $data .= fread($fp4096);
            }

            
    // close socket
            
    fclose($fp);

            
    // return response
            
    return $data;


  4. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    OK thanks. I'll try it out later. This will be especialy useful when I start the FusionCre8 Hosting Platform (fusioncre8.net).

    Thanks again!
    Rednerve
    Creative Freelance Design

  5. #4
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    I don't get it . Can you please explain better?
    Rednerve
    Creative Freelance Design

  6. #5
    Senior Member ajaspers's Avatar
    Join Date
    Apr 2003
    Posts
    149
    Member #
    1150
    For example, to get the WHOIS information for webdesignforums.net: (with that function)

    PHP Code:
    // configuration
    $domain "webdesignforums.net";
    $whoisServer "whois.verisign-grs.com";

    // get domain info from registry whois server (basic info)
    $registryData whois($domain$whoisServer);

    // display registry whois info
    echo "[$whoisServer]\n" $registryData;

    if(
    preg_match("/Whois Server: (.*)/"$registryData$registrar))
    {
      
    // get more detailed information from the registrar whois server
      
    $registrarData whois($domain$registrar[1]);
      
      
    // display registrar whois info
      
    if($registrarData) echo "\n[" $registrar[1] . "]\n" $registrarData "\n";


  7. #6
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    OK. So how do I get it to check if a certain domain name is available? I want it for my hosting site you see...
    Rednerve
    Creative Freelance Design

  8. #7
    Senior Member ajaspers's Avatar
    Join Date
    Apr 2003
    Posts
    149
    Member #
    1150
    For com/net the registry response will be 'No match for "domain.com"'. The org/info registry response will be 'NOT FOUND'

    PHP Code:
    // configuration
    $domain "webdesignforums.net";
    $whoisServer "whois.verisign-grs.com";

    // get domain info from registry whois server (basic info)
    $registryData whois($domain$whoisServer);

    // check if domain is available
    if(preg_match("/^(no match|not found)/im"$registryData))
    {
      echo 
    "$domain is available.";
    }
    else
    {
      echo 
    "$domain is unavailable.";



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:15 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com