login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Statistieken > DNS Status checker (whois) [V1.1]

DNS Status checker (whois) [V1.1]

Auteur: Wim - 02 december 2005 - 23:44 - Gekeurd door: Ontani - Hits: 10290 - Aantal punten: (0 stemmen)



Uploaden, en that's it!

$status heeft de waarde "free" als het domein vrij ter registratie is, "quarantine" als het domein in quarantine is, en "registered" als het domein een andere status heeft (normaal registered)

Up-2-date source (= source van demo):
http://scripting.mizone.be/Source/dnsstatuschecker

Supported extentions:
be, nl, com, org, net, biz, info, fr, nu, tv, uk, me.uk, co.uk, ltd.uk, net.uk, org.uk, plc.uk, ac.uk, cc, bz, ws, name, us, ac.be

SourceForge (SF.NET) page: http://sourceforge.net/projects/dnsstatuscheck

Code:
checker.php [or whatever]:
  1. <?php
  2. // script door GDX^
  3. // Wim Mariën <gdx@mizone.be>
  4. // http://scripting.mizone.be/
  5. //
  6. // Gratis voor gebruik.
  7. //
  8. // Meerdere extenties op aanvraag per PM op Sitemasters.be
  9. // Writed for http://www.sitemasters.be/
  10. //
  11. // Supported extentions: be, nl, com, org, net, biz, info, fr, nu, tv, uk, me.uk, co.uk, ltd.uk, net.uk, org.uk, plc.uk, ac.uk, cc, bz, ws, name, us, ac.be
  12. //
  13. // V1.1
  14. //
  15. // CHANGELOG:
  16. // # 03/12/2005
  17. // # - Added quarantine-status (currently only for .be)
  18. // # - Addes some extentions: nu, tv, uk, me.uk, co.uk, ltd.uk, net.uk, org.uk, plc.uk, ac.uk
  19. // #04/12/2005
  20. // # - Added some extentions: cc, bz, ws, name, uc, ac.be
  21.  
  22. include ("dnsservers.php");
  23.  
  24. if(isset($_REQUEST['lookup'])) {
  25. if(empty($_REQUEST['domain']))
  26. exit ("Please fill in all fields");
  27.  
  28. $ext = $_REQUEST['ext'];
  29.  
  30. $sock = fsockopen($servers[$ext], $ports[$ext], $errno, $errstr, 5);
  31. $command = str_replace ("{domain}", $_REQUEST['domain'], $commands[$ext]);
  32. fputs($sock, $command);
  33. while (!feof($sock))
  34. $output .= fgets($sock, 128)."<br />";
  35. if(preg_match("/".$preg[$ext]."/", $output))
  36. $status = "free";
  37. elseif($quarantine[$ext] !== false && preg_match("/".$quarantine[$ext]."/", $output))
  38. $status = "quarantine";
  39. else
  40. $status = "registered";
  41. fclose($sock);
  42. }
  43. else{
  44. echo ("<form method=\"post\">\n");
  45. echo ("DNS status lookup:<br />\n");
  46. echo ("Domain: <input type=\"text\" name=\"domain\" /> (without www. or extention!)<br />\n");
  47. echo ("Extention:\n <select name=\"ext\">\n");
  48. foreach ($supportedext as $ext)
  49. echo ("<option value=\"".$ext."\">".$ext."</option>\n");
  50. echo ("</select><br />\n<br />\n");
  51. echo ("<input type=\"submit\" name=\"lookup\" value=\"Check status!\" />\n");
  52. echo ("</form>\n");
  53. }
  54. ?>


dnsservers.php:
  1. <?php
  2. $supportedext = array("be", "nl", "com", "org", "net", "biz", "info", "fr", "nu", "tv", "uk", "me.uk", "co.uk", "ltd.uk", "net.uk", "org.uk", "plc.uk", "ac.uk", "cc", "bz", "ws", "name", "us", "ac.be");
  3.  
  4. $servers = array(
  5. "be" => "whois.dns.be",
  6. "nl" => "whois.domain-registry.nl",
  7. "com" => "whois.nsiregistry.net",
  8. "org" => "whois.publicinterestregistry.net",
  9. "net" => "whois.nsiregistry.net",
  10. "biz" => "whois.biz",
  11. "info" => "whois.afilias.info",
  12. "fr" => "whois.nic.fr",
  13. "nu" => "whois.nic.nu",
  14. "tv" => "whois.internic.net",
  15. "uk" => "whois.nic.uk",
  16. "co.uk" => "whois.nic.uk",
  17. "me.uk" => "whois.nic.uk",
  18. "ltd.uk" => "whois.nic.uk",
  19. "net.uk" => "whois.nic.uk",
  20. "org.uk" => "whois.nic.uk",
  21. "plc.uk" => "whois.nic.uk",
  22. "ac.uk" => "whois.nic.uk",
  23. "cc" => "whois.nic.cc",
  24. "bz" => "whois.nic.cc",
  25. "ws" => "whois.nic.ws",
  26. "name" => "whois.nic.name",
  27. "us" => "whois.nic.us",
  28. "ac.be" => "whois.dns.be"
  29. );
  30.  
  31. $ports = array(
  32. "be" => 4343,
  33. "nl" => 43,
  34. "com" => 43,
  35. "org" => 43,
  36. "net" => 43,
  37. "biz" => 43,
  38. "info" => 43,
  39. "fr" => 43,
  40. "nu" => 43,
  41. "tv" => 43,
  42. "uk" => 43,
  43. "co.uk" => 43,
  44. "me.uk" => 43,
  45. "ltd.uk" => 43,
  46. "net.uk" => 43,
  47. "org.uk" => 43,
  48. "plc.uk" => 43,
  49. "ac.uk" => 43,
  50. "cc" => 43,
  51. "bz" => 43,
  52. "ws" => 43,
  53. "name" => 43,
  54. "us" => 43,
  55. "ac.be" => 4343
  56. );
  57.  
  58. $commands = array (
  59. "be" => "GET 1.0 {domain}\r\n",
  60. "nl" => "is {domain}.nl\r\n",
  61. "com" => "{domain}.com\r\n",
  62. "org" => "{domain}.org\r\n",
  63. "net" => "{domain}.net\r\n",
  64. "biz" => "{domain}.biz\r\n",
  65. "info" => "{domain}.info\r\n",
  66. "fr" => "{domain}.fr\r\n",
  67. "nu" => "{domain}.nu\r\n",
  68. "tv" => "{domain}.tv\r\n",
  69. "uk" => "{domain}.uk\r\n",
  70. "co.uk" => "{domain}.co.uk\r\n",
  71. "me.uk" => "{domain}.me.uk\r\n",
  72. "ltd.uk" => "{domain}.ltd.uk\r\n",
  73. "net.uk" => "{domain}.net.uk\r\n",
  74. "org.uk" => "{domain}.org.uk\r\n",
  75. "plc.uk" => "{domain}.plc.uk\r\n",
  76. "ac.uk" => "{domain}.ac.uk\r\n",
  77. "cc" => "{domain}.cc\r\n",
  78. "bz" => "{domain}.bz\r\n",
  79. "ws" => "{domain}.ws\r\n",
  80. "name" => "{domain}.name\r\n",
  81. "us" => "{domain}.us\r\n",
  82. "ac.be" => "GET 1.0 {domain}\r\n"
  83. );
  84.  
  85. $preg = array(
  86. "be" => "FREE",
  87. "nl" => "is free",
  88. "com" => "No match for",
  89. "org" => "NOT FOUND",
  90. "net" => "No match for",
  91. "biz" => "Not found:",
  92. "info" => "NOT FOUND",
  93. "fr" => "No entries found in the AFNIC Database.",
  94. "nu" => "NO MATCH for domain",
  95. "tv" => "No match for",
  96. "uk" => "{domain}.uk\r\n",
  97. "co.uk" => "No match for",
  98. "me.uk" => "No match for",
  99. "ltd.uk" => "No match for",
  100. "net.uk" => "No match for",
  101. "org.uk" => "No match for",
  102. "plc.uk" => "No match for",
  103. "ac.uk" => "No match for",
  104. "cc" => "No match for",
  105. "bz" => "No match for",
  106. "ws" => "No match for",
  107. "name" => "No match.",
  108. "us" => "Not found:",
  109. "ac.be" => "FREE"
  110. );
  111.  
  112. $quarantine = array(
  113. "be" => "QUARANTINE",
  114. "nl" => false,
  115. "com" => false,
  116. "org" => false,
  117. "net" => false,
  118. "biz" => false,
  119. "info" => false,
  120. "fr" => false,
  121. "nu" => false,
  122. "tv" => false,
  123. "uk" => false,
  124. "co.uk" => false,
  125. "me.uk" => false,
  126. "ltd.uk" => false,
  127. "net.uk" => false,
  128. "org.uk" => false,
  129. "plc.uk" => false,
  130. "ac.uk" => false,
  131. "cc" => false,
  132. "bz" => false,
  133. "ws" =>false,
  134. "name" => false,
  135. "us" => false,
  136. "ac.be" => false
  137. );
  138. ?>
Download code! Download code (.txt)

Download dit script! Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (4)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.049s