From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1b19038afdb7c809e1e99e4335acb139@quanstro.net> From: erik quanstrom Date: Mon, 28 Apr 2008 15:08:55 -0400 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] iwhois and ndb for fun and profit Topicbox-Message-UUID: 9ab5d9ea-ead3-11e9-9d60-3106f5b1d025 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