nibblegap logo Domain Name, IP Whois Search System

'; if (!empty($result)) { echo '

' . $domain . ' WHOIS Information

'; echo '
'; echo '

Searched from: ' . $server . '

'; echo '

Domain Registration: ' . ($isRegistered ? 'Registered' : 'Unregistered') . '

'; echo '

Reserved domain name: ' . (isDomainReserved($result) ? 'Reserved' : 'Not Reserved') . ' (Only Reference)' . '

'; foreach ($result as $line) { if (strpos($line, 'Expiration Date') !== false || strpos($line, 'Registrar Registration Expiration Date') !== false || strpos($line, 'Registry Expiry Date') !== false || strpos($line, 'Expiry Date:') !== false || strpos($line, 'Expiration Time:') !== false) { echo '

Expiration Date: ' . trim(str_replace(['Expiration Date:', 'Registrar Registration Expiration Date:', 'Registry Expiry Date:', 'Expiry Date:', 'Expiration Time:'], '', $line)) . '

'; } elseif (strpos($line, 'Creation Date') !== false || strpos($line, 'Domain Registration Date') !== false || strpos($line, 'created:') !== false || strpos($line, 'Registration Time:') !== false) { echo '

Registration Date: ' . trim(str_replace(['Creation Date:', 'Domain Registration Date:', 'created:', 'Registration Time:'], '', $line)) . '

'; } elseif (strpos($line, 'Updated Date') !== false || strpos($line, 'Last Updated') !== false || strpos($line, 'last-update:') !== false) { echo '

Last Updated Date: ' . trim(str_replace(['Updated Date:', 'Last Updated:', 'last-update:'], '', $line)) . '

'; } elseif (strpos($line, 'Name Server') !== false || strpos($line, 'Name Servers') !== false || strpos($line, 'NS') !== false || strpos($line, 'nserver:') !== false) { echo '

DNS: ' . trim(str_replace(['Name Server:', 'Name Servers:', 'NS:', 'nserver:'], '', $line)) . '

'; } elseif (strpos($line, 'Registrant:') !== false || strpos($line, 'Registrant Name:') !== false || strpos($line, 'Registrant Organization:') !== false) { echo '

Registrant: ' . trim(str_replace(['Registrant:', 'Registrant Name:', 'Registrant Organization:'], '', $line)) . '

'; } elseif (strpos($line, 'Registrant Email') !== false) { echo '

Registrant Email: ' . trim(str_replace('Registrant Email:', '', $line)) . '

'; } elseif (!$hasRegistrarInfo && (strpos($line, 'Registrar:') !== false || strpos($line, 'Registrar WHOIS Server') !== false || strpos($line, 'registrar:') !== false)) { echo '

Registrar: ' . trim(str_replace(['Registrar:', 'Registrar WHOIS Server:', 'registrar:'], '', $line)) . '

'; $hasRegistrarInfo = true; } elseif (strpos($line, 'Status:') !== false) { echo '

Status: ' . trim(str_replace('Status:', '', $line)) . '

'; } } echo '
'; echo ''; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; } else { echo '

WHOIS information for the domain name could not be found. The domain name may not be registered or the domain Whois server is not accessible.

'; } echo ''; } else { echo '
'; echo '

WHOIS search for this domain name is not supported.

'; echo '
'; } } function performIPWhoisQuery($ip) { $server = 'whois.apnic.net'; $result = queryWhoisServer($server, $ip); echo '
'; if (!empty($result)) { echo '

' . $ip . ' WHOIS information

'; echo '

Searched from: ' . $server . '

'; echo ''; } else { echo '

IP WHOIS information not available.

'; } echo '
'; } function getDomainExtension($domain) { $parts = explode('.', $domain); $extension = end($parts); return strtolower($extension); } function queryWhoisServer($server, $query) { $result = array(); $fp = @fsockopen($server, 43, $errno, $errstr, 10); if ($fp) { fputs($fp, $query . "\r\n"); while (!feof($fp)) { $result[] = fgets($fp); } fclose($fp); } return $result; } function isDomainReserved($whoisResult) { $reservedKeywords = array('reserved', 'reserved domain name', 'keep', 'clientHold', 'serverHold'); foreach ($whoisResult as $line) { foreach ($reservedKeywords as $keyword) { if (stripos($line, $keyword) !== false) { return true; } } } return false; } function isDomainRegistered($whoisResult) { $registeredPatterns = array( '/^\s*Registrar:\s+/i', '/^\s*Creation Date:\s+/i', '/^\s*Domain Name:\s+/i', '/^\s*Registry Domain ID:\s+/i', '/^\s*connect\s+/i', '/^\s*Status:\s+connect/i', '/^\s*Status:\s+active/i' ); foreach ($whoisResult as $line) { foreach ($registeredPatterns as $pattern) { if (preg_match($pattern, $line)) { return true; } } } return false; } ?>