• 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

    • Well Statcounter doesn't count Edge users as Chrome. It uses the user agent and my understanding is the Brave browser users the standard Chrome user agent for privacy/tracking reasons and compatibility so that would help the Chrome numbers. Some Firefox users change the user agent for again compatibility reasons. I am going to totally guess the Chrome numbers are inflated some 5 or 6%.
    • BATorrent 4.0.0 by Razvan Serea BATorrent is a lightweight, open-source BitTorrent client built with modern C++ and Qt 6, offering a clean, fast, and privacy-focused alternative to traditional torrent apps. It supports magnet links, .torrent files, resume data, sequential downloading, per-file priorities, and even imports from qBittorrent. Power users benefit from integrated RSS auto-download with regex filtering, duplicate detection, and automatic tracker lists from Stremio. Streaming is seamless thanks to auto-detected players like VLC and IINA. BATorrent includes robust VPN tools—interface binding, auto-detection for WireGuard-based services like Mullvad and NordLynx, kill switch, proxy support, and IP filtering. A full WebUI enables remote control, while integrations with Plex, Jellyfin, and Emby automate library updates. With themes, speed scheduling, system-tray alerts, and cross-platform support for Windows, Linux, and macOS, BATorrent delivers a polished, high-performance torrenting experience. BATorrent features: Core .torrent file and magnet link support Resume data — picks up where you left off after restart Import torrents from qBittorrent Create .torrent files from any file or folder Sequential download mode Per-file priority control (skip, low, normal, high) Seed ratio limits with auto-pause DHT, PEX, UPnP, NAT-PMP RSS Auto-Download Subscribe to RSS feeds — automatically download new torrents as they appear Regex filters — match only what you want (e.g. 1080p|720p, S01E\d+) Per-feed settings — custom save path, check interval (5–1440 min), enable/disable Auto-download — matched items are downloaded automatically in the background Supports magnet links, .torrent URLs, and tags Tray notifications when items are auto-downloaded Duplicate detection — never downloads the same item twice Stremio Stremio Addon System pre-installed — works out of the box Auto tracker list from ngosang/trackerslist Streaming Play while downloading — stream video files before the download is complete Supports mp4, mkv, avi, mov, wmv, flv, webm, m4v, ts Auto-detects installed players (VLC, IINA, system default) VPN & Privacy Interface binding — lock torrent traffic to a specific network interface (e.g. tun0) Auto VPN detection — identifies VPN interfaces (tun, tap, WireGuard, Mullvad, NordLynx, ProtonVPN) Kill switch — automatically pauses all torrents if the VPN interface drops Auto-resume — resumes only the torrents paused by the kill switch when VPN reconnects Proxy support — SOCKS5 and HTTP proxy with optional authentication IP filtering — load P2P blocklists to block unwanted IP ranges Protocol encryption (enabled / forced / disabled) WebUI Remote management — control torrents from any browser at http://localhost:8080 REST API with JSON responses Add torrents via magnet link or .torrent upload Pause, resume, remove torrents remotely View peers and files per torrent Dark theme matching the desktop app HTTP Basic Auth with SHA-256 password hashing Configurable port and remote access (localhost vs 0.0.0.0) Interface 3 themes: Dark, Light, Midnight (bat/vampire aesthetic) Real-time speed graph Detailed panel with tabs: General, Peers, Files, Trackers Filter bar: search by name, filter by state (Active, Downloading, Seeding, Paused, Finished) Drag & drop .torrent files and magnet links Drag & drop reorder in torrent list System tray with notifications (download complete, kill switch events, RSS auto-downloads) Splash screen with bat animation Bilingual: English and Portuguese (BR), auto-detected from system locale Bandwidth Scheduler Alternative speed limits — set different download/upload limits on a schedule Time range — configure active hours (e.g. 01:00 to 07:00), supports overnight ranges Per-day control — choose which days of the week the schedule applies Automatically switches between normal and alternative speeds Media Server Integration Plex — automatically trigger library scan when a download completes Jellyfin / Emby — same automatic library refresh via API Configure server URL and authentication token/key in Settings System Cross-platform: Windows, Linux, macOS Auto-shutdown — automatically shut down PC when all downloads complete (60s cancellable countdown) Auto-update system (AppImage on Linux, installer on Windows, DMG on macOS) CLI arguments: pass .torrent files or magnet: URIs directly Keyboard shortcuts: Space to toggle pause, Ctrl+A to select all, Ctrl+O to open Download: BATorrent 4.0.0 | 37.4 MB (Open Source) Download: BATorrent Portable | 51.7 MB Links: BATorrent Website | Screenshot | Changelog Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      jojodbn earned a badge
      One Month Later
    • Week One Done
      jojodbn earned a badge
      Week One Done
    • One Year In
      jojodbn earned a badge
      One Year In
    • Week One Done
      D0nn13 earned a badge
      Week One Done
    • Reacting Well
      lamborghiniv10 earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      517
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      108
    4. 4
      ATLien_0
      88
    5. 5
      Steven P.
      83
  • Tell a friend

    Love Neowin? Tell a friend!