Dns2000 Utility

M. Gallant 11/07/2001

The Java 1.x and 2+ API provide the InetAddress class with methods for Internet host name to IP address resolution and also reverse lookup capability. The official Java2 v1.4 documentation indicates that :

" Host name-to-IP address resolution is accomplished through the use of a combination of local machine configuration information and network naming services such as the Domain Name System (DNS) and Network Information Service(NIS). "

This can cause problems for reverse lookups where the Fully Qualified Domain Name (FQDN) is required. In many cases, the host name returned by getHostName for an enquiry on the localhost is the netbios computer name and not the FQDN as has been reported by many developers. Reverse DNS lookups can be carried out with JNDI and the DNS service provider, available with J2se v1.4, or added as an extension package to j2se v1.3 and lower.

The Dns2000 utility Java application provides an elementary demonstration of using JNDI/DNS provider for reverse DNS lookups to provide FQDN results. If provides similar functionality to the win2000 utility nslookup.exe. The utility is designed to demonstrate how JNDI is used to read the DNS service provider PTR record for reverse DNS lookup. Since the initial context constructor requires specification of a DNS server, this is specified either as a command line parameter, or if not provided, is discovered by invoking the Win2000 native application "nslookup.exe".

Dns2000 application source code

Win32 Utility For Local Host IP and FQDN

These win32 utilites (written in C++ and both digitally signed) simply return the local-machine IP address and perform a reverse DNS lookup with the default DNS server configured on the local machine:
dnsmigquery.exe (command line version)

dnsmigquery.exe (windows popup version)