Skip to content
Andrew Newton edited this page Jun 12, 2016 · 5 revisions

Please edit this page to submit your hack proposal.

NicInfo Hacking

NicInfo is an open source, command-line RDAP client. RDAP, the Registration Data Access Protocol, is a REST/JSON-based replacement for Whois, standardized by the IETF in 2015. There are several RFCs for RDAP, but the two that you really need to read are RFC 7482, describing how to query an RDAP service, and RFC 7483, which shows the JSON responses.

All five RIRs plus Nic.CZ (the .CZ TLD operator) run RDAP servers. And ARIN runs a "bootstrap service", which will redirect queries to the appropriate place: just send queries to https://rdap.arin.net/bootstrap.

Hacking NicInfo The code for NicInfo can be found on GitHub here. The master branch is where mainline development is conducted, and pull requests are accepted in the contrib branch. NicInfo is written entirely in Ruby.

Besides editing the Ruby code, it is also possible to embed NicInfo into other commands for other hacks. The --json option directly outputs the RDAP JSON so that other programs can evaluate the JSON directly (that is NicInfo does the HTTP GET, follows redirects, and does caching but not much more). There is also the --jv option to output a specific JSON value.

Possible Hacks Any idea is welcome, but here are a couple to help get the juices going.

  1. Take the hops listed in a traceroute, and lookup the network containing network via RDAP. One possible way to implement this would be to use the Ruby NMAP gem. A pure, though rough, pure-Ruby implementation of traceroute can be found here.
  2. The RIPEStat service as a REST/JSON API that has useful queries that could be used to add additional features to NicInfo. One such idea is to lookup a client's own IP address, and then query RDAP for the containing network.
  3. Integration with a local router. Some routers have REST APIs (see http://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/restapi/restapi.html). Or scripts that log into the routers could invoke NicInfo. One possible idea is to find the registration information for an AS that is the origin of a particular route.
  4. Convert network ranges to CIDR. This GitHub issue is a request to show networks by CIDR instead of just ranges. The trick to this one is to remember that not all network registrations fall neatly on a single CIDR boundary, and therefore might have to be broken up into multiple CIDR blocks.
  5. Apparently the .deb file for NicInfo does not work. Fixing this would be a help.
  6. Believe it or not, NicInfo does not have a Rake file. The addition of even a basic Rake file to run the tests would be helpful.

Clone this wiki locally