-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
WordPress-Theme Twenty Twenty Four-customizing: how to do that - a Gutenberg special question...
By thedhubs,
- 1 answer
- 1,773 views
-
- 0 replies
- 0 views
-
- 0 replies
- 0 views
-
- 0 replies
- 3 views
-
- 1 reply
- 4 views
-
Question
-Alex-
Hi all,
Thought this might be useful to someone, so I'm releasing it into the wild! It creates a database that looks like this:
Mod's: this is completely above-board... WHOIS is provided by InterNIC via port 43 for unlimited free lookups.
Enjoy! :D
<?php set_time_limit(0); $dbhost = 'localhost'; $dbuser = 'foo'; $dbpass = 'bar'; $dbname = 'whois'; $dh = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); for($i = 'aaa'; $i <= 'zzzz'; $i++) { $len = strlen($i); if($conn = fsockopen ('whois.internic.net', 43)) { $output = NULL; fputs($conn, "domain $i.com\r\n"); while(!feof($conn)) { $output .= fgets($conn, 128); } fclose($conn); } if(strpos($output, 'No match for domain') !== FALSE) mysql_query("INSERT INTO `domains` VALUES ('$i', '$len', 1, '0000-00-00', NULL);") or die($i . ' - ' .mysql_error()); else { preg_match('/Expiration Date: (.+?)\n/', $output, $expires); $expires = strtotime($expires[1]); $expires = date('Y-m-d', $expires); mysql_query("INSERT INTO `domains` VALUES ('$i', '$len', 0, '$expires', NULL);") or die($i . ' - ' .mysql_error()); } } mysql_close($dh); ?>
Link to comment
https://www.neowin.net/forum/topic/1040731-small-powerful-script-to-dump-all-coms-their-status-into-a-db/Share on other sites
12 answers to this question
Recommended Posts