2

I create php script for scan domains and know if free or no for register

<?php
if($_REQUEST['send']=="ok")
{
$server="".trim($domain_server_end)."";
$request="".trim($domain_server_end_request)."";



$dominio="".$_REQUEST['dominio_nombre']."";
$dominio_ext="".$_REQUEST['dominio_ext']."";
$ns = fsockopen($server,43); 
fputs($ns,"".$dominio.".".$dominio_ext."\r\n");
$result = '';
while(!feof($ns)) $result .= fgets($ns,128);
fclose($ns);

if (eregi($request,$result)) 
{ 
print'{"domain_register":"ok"}';
}
else
{
print'{"domain_exists":"ok"}';
}
}
?>



    <form name="form1" method="post" action="?">
    Server Whois<br>
    <input type="text" name="$domain_server_end"><br>
      Server whois request from server : example : No Match , etc
      <input type="hidden" name="send" value="ok">
      <br>
    <input type="text" name="domain_server_end_request"><br>
   Domain name<br>
    <input type="text" name="dominio_nombre"><br>
    Extension Domain without dot<br>
    <input type="text" name="dominio_ext">

      <br><input type="submit" name="Submit" value="Enviar">
    </form>

The problem here it´s with the TLDs , i can´t find whois servers for works the script , i have one for works but i don´t know why now no works , if you can tell me something for works with some TLDs perfect because the script run ok but i can´t find whois servers for use it :(

X-Blaster
  • 1,751
  • 3
  • 15
  • 32
user1860536
  • 67
  • 2
  • 7
  • You realize that scraping websites is generally not allowed. Maybe you can find a company that has an API for WhoIs lookups? – Tarilo Feb 19 '13 at 11:03
  • There is an API, check this thread http://stackoverflow.com/questions/36817/who-provides-a-whois-api – sascha Feb 19 '13 at 11:07

1 Answers1

3

Every TLD has a different whois server, and not all TLDs provide one. You can find a list of all TLD servers in my OS whois library.

This is the TLD definition list: https://github.com/weppos/whois/blob/master/data/tld.json

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364