9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] iwhois and ndb for fun and profit
@ 2008-04-28 19:08 erik quanstrom
  0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2008-04-28 19:08 UTC (permalink / raw)
  To: 9fans

whois is kind of a gnarly problem.  there are no standards.
referral isn't requires so you need a list of machines to start
with.  (hoping that they will refer you.)  and you need to know
which character set each machine returns.  remember, no standards.
and finally, the query isn't really standard, so that needs to
depend on the whois server as well.

but it turns out that ndb has all the tools that one needs to
build such an ad-hoc database.  it's trivial to associate tlds to
whois servers.  it's trivial to associate those with character sets,
query transformations and deboilerplating functions.  and
ipquery knows how to match cidr ranges so that given an association
of cidr blocks to machines and an ip, the correct whois server
can be determined for ip4 and ip6 queries.

the source is here: /n/sources/contrib/quanstro/src/iwhois.
it's a ~130 line rc script and 500 lines of ndb rules.

i'd be happy to know of any fixes or database updates.

- erik



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-28 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 19:08 [9fans] iwhois and ndb for fun and profit erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).