jresolver - The java DNS resolver library

This is a domain name resolver library written in pure java. It is what RFC1034
describes as a stub resolver, in other words it uses a single nameserver to
do the hard work of resolving it's queries. At the moment it only handles
queries for MX records, but it can easily be extended to resolve new types of
queries as needed.

Download

jresolver-0.1.zip

Features

- Lightweight. The binary jar is less than 17k at the moment, and has no
exernal dependencies besides JDK 1.4.

- Multi Threaded. It handles multiple concurrent threads sharing a single
Resolver instance.

- Easy to use and develop. The software does one thing, and the code is quite
readable.

- Free software. Released under the GPL 3.0 license, this software can be used,
modified and redistributed by anyone respecting the terms of the license. If you
need other licensing options, please contact me.

Usage

A snippet of code says more than lots of words: 

  Resolver r = new Resolver("ns.voxbiblia.se");
  List l = r.resolve(new MXQuery("voxbiblia.se"));
  for (int i = 0; i < l.size(); i++) {
    MXRecord mx = (MXRecord)l.get(i);
    System.out.println("mx: " + mx.getExchange() + " p: "+ mx.getPreference());
  }

If you want to build and test the software you need to unpack the files named
jresolver-*-src.tar.bz2 and jresolver-*-test.tar.bz2 and use Apache Ant with
the build.xml file included. You may need to update the test cases with your
dns server names.

Credits

This software is developed and maintained by Noa Resare with support from
Voxbiblia. Thanks guys for letting me do this! I want to give credit to the
author of dnsjava (http://xbill.org/dnsjava/), a piece of software that I had a
look at before I decided that it would be fun to write my own library with
RFC1035 as a starting point.

Contact

Feel free to write me with comments, suggestions, bug reports and patches.
Noa Resare (noa@voxbiblia.com)