• 0

Small powerful script to dump all .com's & their status into a db


Question

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:

post-176093-0-87487100-1322016228.png

Mod's: this is completely above-board... WHOIS is provided by InterNIC via port 43 for unlimited free lookups.

Enjoy! :D

CREATE TABLE `domains` (
  `domain` varchar(6) NOT NULL,
  `len` tinyint(1) unsigned NOT NULL,
  `available` tinyint(1) unsigned NOT NULL,
  `expires` date NOT NULL,
  `checked` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`domain`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

<?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);
?>

  • Like 1

12 answers to this question

Recommended Posts

  • 0

Well this script finally finished going from aaa to zzzz in about 36 hours. None of the domains were available, but around 1500 of them have expired. I've attached the list of expired .com domains in Excel format if anyone wants it. Can't upload any file ending .csv, .xls, or .xlsx - wtf Neowin?!

They first go into a period of redemption, where the original owner can claim them back for about 80 days after it expires. Then they go into pendingDelete, and 5 calendar days later, they're free to whoever can claim them first!

Oh, and you can query any of these WHOIS servers via port 43:

http://www.nirsoft.net/whois-servers.txt

ac whois.nic.ac

ae whois.aeda.net.ae

aero whois.aero

af whois.nic.af

ag whois.nic.ag

al whois.ripe.net

am whois.amnic.net

as whois.nic.as

asia whois.nic.asia

at whois.nic.at

au whois.aunic.net

az whois.ripe.net

ba whois.ripe.net

be whois.dns.be

bg whois.register.bg

bi whois.nic.bi

biz whois.neulevel.biz

bj www.nic.bj

br whois.nic.br

bt whois.netnames.net

by whois.ripe.net

bz whois.belizenic.bz

ca whois.cira.ca

cat whois.cat

cc whois.nic.cc

cd whois.nic.cd

ch whois.nic.ch

ck whois.nic.ck

cl nic.cl

cn whois.cnnic.net.cn

co whois.nic.co

co.nl whois.co.nl

com whois.verisign-grs.com

coop whois.nic.coop

cx whois.nic.cx

cy whois.ripe.net

cz whois.nic.cz

de whois.denic.de

dk whois.dk-hostmaster.dk

dm whois.nic.cx

dz whois.nic.dz

edu whois.educause.net

ee whois.tld.ee

eg whois.ripe.net

es whois.ripe.net

eu whois.eu

fi whois.ficora.fi

fo whois.nic.fo

fr whois.nic.fr

gb whois.ripe.net

ge whois.ripe.net

gl whois.nic.gl

gm whois.ripe.net

gov whois.nic.gov

gr whois.ripe.net

gs whois.nic.gs

hk whois.hknic.net.hk

hm whois.registry.hm

hn whois2.afilias-grs.net

hr whois.ripe.net

hu whois.nic.hu

ie whois.domainregistry.ie

il whois.isoc.org.il

in whois.inregistry.net

info whois.afilias.info

int whois.isi.edu

iq vrx.net

ir whois.nic.ir

is whois.isnic.is

it whois.nic.it

je whois.je

jobs jobswhois.verisign-grs.com

jp whois.jprs.jp

kg whois.domain.kg

kr whois.nic.or.kr

la whois2.afilias-grs.net

li whois.nic.li

lt whois.domreg.lt

lu whois.restena.lu

lv whois.nic.lv

ly whois.lydomains.com

ma whois.iam.net.ma

mc whois.ripe.net

md whois.nic.md

me whois.nic.me

mil whois.nic.mil

mk whois.ripe.net

mobi whois.dotmobiregistry.net

ms whois.nic.ms

mt whois.ripe.net

mu whois.nic.mu

mx whois.nic.mx

my whois.mynic.net.my

name whois.nic.name

net whois.verisign-grs.com

nf whois.nic.cx

ng whois.nic.net.ng

nl whois.domain-registry.nl

no whois.norid.no

nu whois.nic.nu

nz whois.srs.net.nz

org whois.pir.org

pl whois.dns.pl

pr whois.nic.pr

pro whois.registrypro.pro

pt whois.dns.pt

ro whois.rotld.ro

ru whois.ripn.ru

sa saudinic.net.sa

sb whois.nic.net.sb

sc whois2.afilias-grs.net

se whois.nic-se.se

sg whois.nic.net.sg

sh whois.nic.sh

si whois.arnes.si

sk whois.sk-nic.sk

sm whois.nic.sm

st whois.nic.st

su whois.ripn.net

tc whois.adamsnames.tc

tel whois.nic.tel

tf whois.nic.tf

th whois.thnic.net

tj whois.nic.tj

tk whois.nic.tk

tl whois.domains.tl

tm whois.nic.tm

tn whois.ripe.net

to whois.tonic.to

tp whois.domains.tl

tr whois.nic.tr

travel whois.nic.travel

tw whois.twnic.net.tw

tv whois.nic.tv

tz whois.tznic.or.tz

ua whois.ua

uk whois.nic.uk

gov.uk whois.ja.net

us whois.nic.us

uy nic.uy

uz whois.cctld.uz

va whois.ripe.net

vc whois2.afilias-grs.net

ve whois.nic.ve

vg whois.adamsnames.tc

ws www.nic.ws

xxx whois.nic.xxx

yu whois.ripe.net

  • 0

Something like below... I don't have a domain I know is pending delete to test this on, but whatever it comes up with in the whois record should be where I've put 'pendingDelete' :)

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());
elseif(strpos($output, 'pendingDelete') !== FALSE)
  mysql_query("INSERT INTO `domains` VALUES ('$i', '$len', 2, '$expires', 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());
}

  • 0

Hi Alex,

How can I modify the script to search just for the domains with PendingDelete value? I mean to not search for all domains from "a" to "aaa..." but just for all the domains in the registrar database that have the Pending Delete value.

It is consuming too many resurces to go thru all the domain letter combinations. Can the script identify directly just the PendingDelete domains?

Thanks,

Dan

This topic is now closed to further replies.
  • Posts

    • "Of course the easiest solution is to switch to uBlock Origin Lite if you want to remain on Chrome, as it is MV3-based, but from our experience, uBO Lite does not seem to be as good as the original non-Lite version" In my experience uBlock Origin Lite does the job for normal everday home users. When they kill that we get to watch Firefox and Brave get a boost in user market share.
    • Block by DNS ad blocker! I dare you! I will even layer unlock Origin, on top of my internal DNS, if I need to and I don’t even block ads today (I really should but this type of behavior makes me angry). I suppose I could also just be lazy, and add the flags myself, back to each release (it wouldn’t be that difficult).
    • Wonder what MPs have ties to these privacy/verification/data harvesting companies that are going to step in this time. Last time under the Tories half the cabinet had fingers in the pies, heck even the PM and his wife at the time was working for silicon valley, probably made a fortune.
    • Google Chrome is killing all uBlock Origin bypasses, Microsoft Edge, Opera to follow by Sayan Sen For a while now the transition away from Manifest V2 (MV2) to MV3 has been on-going and it looks like it is entering its final phase of deprecation, at least, in the case of Google Chrome. A recent discussion thread in the w3c WebExtensions Community Group GitHub repo has highlighted how the latest and upcoming versions of the most popular browser are expected to be its final releases with support for MV2 extensions. Chromium contributor Andrey Bershanskiy shared details about recent Chromium changes and according to comments from Google engineer Devlin Cronin, Chrome has now started removing the flags that previously controlled MV2 availability. kExtensionManifestV2Disabled, the Chromium feature flag that allowed controlled disabling of MV2 add-ons, is now completely removed, which means you will likely no longer find uBlock Origin in your browser extensions list. He wrote: "The kExtensionManifestV2Disabled feature has been default-enabled for over a year. Remove the feature and the effectively-dead code. ... Any tests that relied on being in the "warning" phase (i.e., with the kExtensionManifestV2Disabled) for their sole behavior testing are removed, since this stage is no longer reachable." Cronin further explained why MV2 extensions are no longer allowed in supported Chrome versions as maintaining the associated functionality indefinitely is no longer possible. He cited growing technical difficulties and implementation complexities as well as security concerns. He wrote: "MV2 extensions are no longer allowed in any supported version of Chrome, and we are removing support for them and the associated functionality. We won't be able to provide / maintain this functionality indefinitely due to the complexity and tech debt, as well as the security risks it entails (we've actually found a number of bugs that are specific to MV2 lately). Of course, other browsers can continue supporting these if they so desire. Unfortunately, we won't be putting code behind a compilation flag ... We won't be removing all the MV2 code wholesale right away, so many of these things will continue working for awhile (but they will go away eventually, and some may go away sooner than others)." What this essentially means is that the tricks and bypasses that were used to keep MV2 extensions like uBlock Origin and others alive will not work any more on Chrome, or at least not for very long. For example the Windows Registry mod that could extend MV2 availability will cease to function after Chromium version 151. Here is a rundown of the changes coming in the final such releases of Chromium releases: Chromium 150 lost ExtensionManifestV2Disabled option Chromium 151 will loose ExtensionManifestV2Unsupported option Chromium 151 will loose ExtensionManifestV2Availability option Chromium 151 will likely loose AllowLegacyMV2Extensions option Other Chromium-based browsers like Opera and Microsoft Edge could soon follow suit too. Although it is not specified, Edge began disabling uBlock Origin back in February, and Opera could also stop the functioning of MV2 add-ons, even though it had committed to support MV2 for longer in October 2024. uBlock Origin developer Raymond Hill (gorhill) apparently stated the following: "For Opera I did submit 1.70.0 rather late, but this was weeks ago. A while ago I received an email from Opera that they plan to abandon MV2-based extension so maybe they are no longer allocating resources for reviewing such extensions." The email which developers like Gorhill mentions was received from Opera last year. Here is what it seemingly said: Hence for now the only Chromium browser that seems to be on-board fully with MV2 support is Brave, and perhaps Vivaldi as well. Meanwhile if you want to ditch Chromium browsers entirely then Mozilla Firefox is an excellent alternative as MV3 and MV2 are both supported. Of course the easiest solution is to switch to uBlock Origin Lite if you want to remain on Chrome, as it is MV3-based, but from our experience, uBO Lite does not seem to be as good as the original non-Lite version. Source: w3C (GitHub repo) As an online publication, Neowin too relies on ads for operating costs and, if you use an ad blocker, we'd appreciate being whitelisted. In addition, we have an ad-free subscription for $28 a year, which is another way to show support!
    • Write to your MP 😄 Like believing in Santa. Total surveillance IS the goal. Wake up.
  • Recent Achievements

    • One Month Later
      mobmobiles earned a badge
      One Month Later
    • Very Popular
      Captain_Eric earned a badge
      Very Popular
    • One Month Later
      amusc earned a badge
      One Month Later
    • One Month Later
      DJC50PLUS earned a badge
      One Month Later
    • Week One Done
      DJC50PLUS earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      510
    2. 2
      PsYcHoKiLLa
      219
    3. 3
      ATLien_0
      92
    4. 4
      +Edouard
      90
    5. 5
      Steven P.
      82
  • Tell a friend

    Love Neowin? Tell a friend!