dnsjava is a popular implementation of DNS in Java. It supports all defined record types (including the DNSSEC types), and unknown types. It can be used for queries, zone transfers, and dynamic updates. It includes a cache which can be used by clients, and a minimal implementation of a server. It supports TSIG authenticated messages, partial DNSSEC verification, and EDNS0.

It is used by several popular projects like * Muffin - a filtering proxy server, JAMES - Java Apache Mail Server currently owned by JBoss, CustomDNS - a configurable DNS server, JacORB - a Java ORB, Jackpot - an SMTP relay honeypot, Scarab - a popular defect tracking system etc.

dnsjava is distributed under BSD license. Highly recommended.

You can download the java source and documentation for dnsjava here.