\n"; echo "\n"; echo "\n"; echo "\n"; echo "WHOIS\n"; echo "\n"; include("/var/www/conf/PHP_PWS/prod_pws.php"); include("/var/www/INRS/utils.php"); function getSleepTime() { // Get users addr $uaddr = $_SERVER["REMOTE_ADDR"]; $fdname = "/tmp/WHOIS_TIME/" . $uaddr; // See if this file exists if (is_file($fdname)) { // open and read the file $file = fopen($fdname, "r"); $work = fgets($file, 64); $tyme = strtok($work, "\t"); $secs = strtok("\t\n"); fclose ($file); // Is last time less than 2 seconds ago? $now = time(); if ($tyme > ($now - 5)) { $file = fopen($fdname, "w"); $out = sprintf("%ld\t%d\n", $now, $secs + 20); fputs($file, $out); fclose($file); $rc = $secs + 20; } else { $file = fopen($fdname, "w"); $out = sprintf("%d\t0\n", $now); fputs($file, $out); fclose($file); $rc = 0; } } // else - write a new file - set 0 secs as time else { // Get current ctime $now = time(); // open file $file = fopen($fdname, "w"); // write "time()\t0" $out = sprintf("%ld\t0\n", $now); fputs($file, $out); // close file fclose ($file); $rc = 0; } return $rc; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo " INRS Whois Lookup\n"; echo " \n"; echo "
\n"; if (strlen($_POST["txtDOMAIN"])) $strDOMAIN = $_POST["txtDOMAIN"]; else $strDOMAIN = $_REQUEST["txtDOMAIN"]; if (!validate_fqdn($strDOMAIN)) $strDOMAIN = ""; if (strlen($_POST["txtDOMAIN"]) Or strlen($_REQUEST["txtDOMAIN"])) { // Check sleep time $sltime = getSleepTime(); if ($sltime) sleep($sltime); $strDOMAIN = strtoupper($strDOMAIN); $strSQL = "SELECT \n". " DD.OWNER_HANDLE, \n". " DD.REGISTRAR_HANDLE, \n". " RR.TITLE, \n". " DD.RESERVE_CODE, \n". " DD.RESERVE_HANDLE, \n". " DD.DELETE_FLG, \n". " DD.PUBLISH_DNS_FLG, \n". " DD.LOCK_FLG, \n". " DD.CREATE_DT, \n". " DD.MODIFY_DT, \n". " DD.EXPIRE_DT, \n". " DD.DELETE_DT, \n". " DD.NAMESERVER_CNT, \n". " DD.NS1_HOST_NM, \n". " DD.NS1_IP_ADDR, \n". " DD.NS2_HOST_NM, \n". " DD.NS2_IP_ADDR, \n". " DD.NS3_HOST_NM, \n". " DD.NS3_IP_ADDR, \n". " DD.NS4_HOST_NM, \n". " DD.NS4_IP_ADDR, \n". " DD.NS5_HOST_NM, \n". " DD.NS5_IP_ADDR, \n". " DD.NS6_HOST_NM, \n". " DD.NS6_IP_ADDR, \n". " DD.NS7_HOST_NM, \n". " DD.NS7_IP_ADDR, \n". " DD.NS8_HOST_NM, \n". " DD.NS8_IP_ADDR, \n". " DD.NS9_HOST_NM, \n". " DD.NS9_IP_ADDR, \n". " DD.NS10_HOST_NM, \n". " DD.NS10_IP_ADDR, \n". " DD.NS11_HOST_NM, \n". " DD.NS11_IP_ADDR, \n". " DD.NS12_HOST_NM, \n". " DD.NS12_IP_ADDR, \n". " DD.NS13_HOST_NM, \n". " DD.NS13_IP_ADDR, \n". " WN.TITLE, \n". " WN.PRIVACY_FLAG, \n". " WN.CONTACT_FIRST, \n". " WN.CONTACT_LAST, \n". " (CASE WN.CONTACT_MIDDLE WHEN NULL THEN '' ELSE WN.CONTACT_MIDDLE END) AS MIDDLE, \n". " WN.CONTACT_EMAIL, \n". " WN.ADDRESS1, \n". " (CASE WN.ADDRESS2 WHEN NULL THEN '' ELSE WN.ADDRESS2 END) AS MIDDLE, \n". " (CASE WN.CITY WHEN NULL THEN '' ELSE WN.CITY END) AS CITY, \n". " (CASE WN.STATE WHEN NULL THEN '' ELSE WN.STATE END) AS STATE, \n". " WN.POSTAL, \n". " WN.NATION, \n". " WN.PHONE1, \n". " (CASE WN.PHONE2 WHEN NULL THEN '' ELSE WN.PHONE2 END) AS PHONE2, \n". " (CASE WN.FAX WHEN NULL THEN '' ELSE WN.FAX END) AS FAX, \n". " (CASE WN.PAGER WHEN NULL THEN '' ELSE WN.PAGER END) AS PAGER, \n". " (CASE WN.CELLPHONE WHEN NULL THEN '' ELSE WN.CELLPHONE END) AS CELLPHONE \n". "FROM \n". " DOMAIN_DATA AS DD, \n". " REGISTRAR_DATA AS RR, \n". " OWNER_DATA AS WN \n". "WHERE \n". " DD.REGISTRAR_HANDLE = RR.REGISTRAR_HANDLE AND \n". " DD.OWNER_HANDLE = WN.OWNER_HANDLE AND \n". " DD.DOMAIN_NAME = '".$strDOMAIN."' "; $CN = mysql_connect(DB_HOST, DB_UID, DB_PW); mysql_select_db(DB_DB, $CN); $rs = mysql_query($strSQL, $CN); if (!mysql_num_rows($rs)) { echo "

\n"; echo "\n"; echo "That Domain doesnt exist.or is invalid.\n"; echo "

\n"; } else { $row = mysql_fetch_row($rs); echo "

".$strDOMAIN."

\n"; if ($row[3] != "N") { if (substr($row[4],0,2) == "RR") $strPFX = "REGISTRAR"; else $strPFX = "REGISTRY"; $strSQL = "SELECT * FROM ".$strPFX."_DATA WHERE ".$strPFX."_HANDLE ='".$row[4]."' "; $rs2 = mysql_query($strSQL, $CN); if (!mysql_num_rows($rs2)) { $strTITLE = "None"; $strHDL = $row[4]; } else { $row2 = mysql_fetch_row($rs2); $strTITLE = $row2[1]; $strHDL = $row[4]; } echo "This domain is reserved by a ".$strPFX.": "; echo $strTITLE." (".$strHDL.")"; echo "
\n"; echo "
\n"; echo "\n"; } else { echo "Current Registrar: ".$row[2]." (".$row[1].")
\n"; echo "OwnerID  ".$row[0]."

\n"; echo "
\n"; if ($row[40] == "Y") { echo "

\n"; echo "The owner of this domain is marked as PRIVATE. \n"; echo "No identifying information about the registrant can be made public\n"; echo "

\n"; echo "
\n"; echo "
\n"; } else { echo "

".$row[39]."
\n"; echo " ".$row[41]." ".$row[43]." ".$row[42]."
\n"; echo " ".$row[45]."
\n"; if (strlen($row[46])) echo " ".$row[46]."
\n"; echo " ".$row[47]; if (strlen($row[48])) echo ", ".$row[48]."
\n"; else echo "
\n"; if (strlen($row[49])) echo " ".$row[49]."
\n"; echo " ".$row[50]."

\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (strlen($row[52])) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } if (strlen($row[53])) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } if (strlen($row[54])) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } if (strlen($row[55])) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; } // if Not private } // If not reserved echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($row[3] == "N") { echo " \n"; if ($row[6] == "Y") $strPUBWORDS = "ENABLED"; else $strPUBWORDS = "DISABLED"; echo " \n"; echo " \n"; echo " \n"; $idx = 13; for ($i=1; $i<=$row[12]; $i++) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; $idx += 2; } } // If not reserved echo " \n"; echo " \n"; echo " \n"; echo " \n"; if (($row[5] == "Y") Or ($row[40] == "Y")) { if ($row[5] == "Y") $strMSG = "This domain is deleted. It was deleted on ".dt_yyyymmdd_to_print($row[11]); if ($row[40] == "Y") $strMSG = $strMSG . "
Privacy service enabled for this owner."; echo " \n"; echo " \n"; echo " \n"; echo " \n"; } echo "
E-Mail Address".$row[44]."
Phone #1:".$row[51]."
Phone #2:". $row[52]. "
Fax:". $row[53] ."
Pager:". $row[54] ."
Cell Phone:" . $row[55] ."
Created On:".dt_yyyymmdd_to_print($row[8])."
Last Modified On:".dt_yyyymmdd_to_print($row[9])."
Expires On:".dt_yyyymmdd_to_print($row[10])."
Nameservers:(".$row[12].") - Publishing: ".$strPUBWORDS."
".$row[$idx]."".$row[$idx+1]."
NOTE(S):".$strMSG."\n"; echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; } // EndIF This is a valid domain mysql_free_result($rs); mysql_close($CN); } // EndIF This is a domain run echo "
\n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Enter a Domain Name to\n"; echo " look up:
\n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "

\n"; echo "The INRS WHOIS can be used to look up any domains that are registered in the Inclusive Namespace \n"; echo "Registry System (INRS). This WHOIS is not linked to any ICANN-related database, therefore you cannot\n"; echo "look up any .COM, .NET or .ORG domains. Rate-limiting mechanisms are installed to prevent 'mining'\n"; echo "or other inpermissible actions.\n"; echo "

\n"; echo "\n"; echo "\n"; ?>