Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2002
    Posts
    31

    Howto Whois Server

    Hello all,

    I wish to create my own server WHOIS.
    how to make ?

    I can do it on a server of the linux type, but does there exist package to create WHOIS server with mysql base (or other sql database) ?

    The server will have to allow the incorporation of domain names with their details (registrant, adress, phone,) and will have to allow to be questioned like any server WHOIS.

    thank you by advance for your assistance.

    thorin

  2. #2
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    169
    I don't think so... But, you can work with the "whois" command in the linux shell/terminal and look in the source of that program (not sure if it's opensource) hench, a php script that contacts the whois program should be very easy. From there it's a piece of cake to store it in a db.
    SwedenDedicated Unmanaged & managed solutions.
    Dedicated Servers, VPS and colocation in Sweden - Stockholm.
    100Mbit Unmetered servers
    Follow us on twitter @swedendedicated

  3. #3
    Join Date
    Mar 2002
    Location
    CH
    Posts
    496
    The whois protocol is quite simple. Basically you just need to have a program that listens to port 43. Every command that comes comes terminated by a new line and you answer with your output.

  4. #4
    Join Date
    Jan 2003
    Posts
    39
    The WHOIS protocol is documented here:
    http://www.ietf.org/rfc/rfc3912.txt

    It's basically

    => CLIENT CONNECTS TO SERVER PORT 43
    C: domain.com\r\n
    S: (c)Registrar\r\n
    S: This domain is registererd\r\n
    S: ...\r\n
    => SERVER CLOSES CONNECTION

    PM me if you need help.

  5. #5
    Join Date
    Jul 2009
    Location
    Manila
    Posts
    301
    Quote Originally Posted by fips View Post
    The WHOIS protocol is documented here:
    http://www.ietf.org/rfc/rfc3912.txt

    It's basically

    => CLIENT CONNECTS TO SERVER PORT 43
    C: domain.com\r\n
    S: (c)Registrar\r\n
    S: This domain is registererd\r\n
    S: ...\r\n
    => SERVER CLOSES CONNECTION

    PM me if you need help.
    Do you know where I can get a script to set up my own whois? well actually what i need is a whois for subdomains, like check if they "Resolve" and if they don't, the whois will return the subdomain as "available" for registration.

  6. #6

    Thumbs up Simply use xinetd + php script

    If you can make a PHP script that outputs the information you want, you're almost there.
    Code:
    #!/usr/bin/php
    #
    # -- /usr/local/bin/mywhois --
    #
    <?php
      $search = fgets(STDIN);
      
      $db = new mysqli('localhost', 'myuser', 'mypwd', 'somedb');
      $result = $db->query('SELECT * FROM domain WHERE name="' . mysqli::real_escape_string($search) . '"');
    
      if ($result->num_rows == 0) {
        echo "Not found";
        exit();
      }
    
      $domain = $result->fetch_assoc();
      echo "Name:     ", $domain['name'], "\n";
      echo "Owner:    ", $domain['owner'], "\n";
      echo "Exp date: ", $domain['end_date'], "\n";
    Make sure the script is executable.

    Next use xinetd (or another inetd) to listen on port 43 and call the script.
    Code:
    # -- /etc/xinetd.d/whois --
    #
    # description: An xinetd service which outputs whois info.
    service whois
    {
    	disable		= no
    	socket_type	= stream
    	protocol	= tcp	
    	user		= root
    	server		= /usr/local/bin/mywhois
    	wait		= no
    }
    That's it
    Last edited by adaniels; 02-04-2010 at 12:59 PM.

  7. #7
    Thank You I might Use It

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •