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

Reply via email to