DummyDNS is a very minimal DNS server which responds to requests to map a supplied name to a corresponding IP address (ie A record lookups). Any other type of request results in an error response code being returned. It is an authorative, non-recursive, non-hierarchical server. It has no concept of the DNS domain name hierarchy, it either knows a name (treated as an unstructured string) has a corresponding address, or assumes it is unknown.
It is designed for use on small, isolated, test networks, such as the lab networks for Cisco CCNA or similar, data networks courses. For these it assists by allowing simple DNS name lookups to occur with a very simple and minimalist configuration. If you want anything smarter than that, or that interacts with the real Internet DNS, then this is not the program for you!
Since DummyDNS is written in Java, it will run on any system with a suitable Java runtime. If one is not present already on your system, it may be obtained from Sun Microsystems - http://java.sun.com/j2se/. This version was written and tested using Java v1.4.2.
The DummyDNS suite comprises the following files:
DummyDNS.jar- the main Java JAR archive, which contains all the compiled program class files. This is an executable jar file, which may be run directly if your system knows how to do this, or by using the command:
java -jar DummyDNS.jar
Otherwise you'll need one of the following script files as well:
DummyDNS- a Unix shell script to run the DummyDNS program, with option arguments if desired.
DummyDNS.bat- a DOS batch file for running the DummyDNS program under Windows in GUI mode.
The source distribution for this program comprises:
DummyDNS.java- the source for the main DummyDNS program, including main routine, server code and command-line interface handling
DummyGUI.java- the source for the GUI interface to the DummyDNS program
DNS.java- assorted DNS constants (JNP code)
DNSInputStream.java- parse DNS query from packet (JNP code)
DNSQuery.java- process DNS query & response (JNP code)
Makefile- a Unix Makefile for compiling and packaging the program
manifest.txt- a JAR manifest file naming the main class so that the resulting jar file is executable
README.html- this documentation file.
dns.txt- sample DNS config file
To install it on your system, provided you have a Java runtime present,
you need only copy the jar file and the appropriate script file to a
suitable location on your system. All of the above files are bundled in the
DummyDNS.jar JAR file, and can
be extracted using the command:
jar xvf DummyDNS.jar
DummyDNS can run in both command-line and GUI modes, as follows:
In more detail, when run, if no arguments are supplied a GUI interface is launched with buttons to load a configuration and start the server, or quit; plus a log output window.
If started with command-line arguments, either a short usage message is displayed if the '-h" flag is given, or the first argument is assumed to be the name of the configuration file, which is loaded, and the server started in command-line mode, with logging to stderr.
Note that since the server has to bind to the privileged UDP port 53 which is reserved for DNS use, it must be run with appropriate root/administrator privileges on most respectable O/S's. This also means that it cannot be run on a system with a "real" DNS server running already. That of course is not a problem for its target market of isolated lab networks.
The configuration file contains lines of
pairs, whose name is supplied to the constructor. The format is rigid.
It accepts lines starting with # as a comment. Any other extraneous
characters may cause an error when parsing it.
Lastly a default entry is always added for "
eg. a minimalist config for a single-router + switch Cisco lab might be:
# simple single-router + switch Cisco lab config router 192.168.1.1 switch 192.168.1.2 pc1 192.168.1.10 pc2 192.168.1.11If the above were saved in the file
dns.txt, then the server could be run in command-line mode using the command:
java DummyDNS dns.txt(or if running out of the jar archive:
java -jar DummyDNS.jar dns.txt). nb. a copy of this "dns.txt" is included in the jar archive as an example.
With the server running, it is then necessary to configure the client systems (eg PC's and routers) on the test/demo networks to use it as their name server. On PC's and other worlstations, you need to specify the "DNS Name Server" address to be that of the host you are running the DummyDNS program on. On Cisco routers, you use the global configuration commands:
ip domain-lookup ip name-server server-address
The DNS query/response handling (in DNS*.java) code in DummyDNS uses code adapted from:
Java Network Programming, Second Edition Merlin Hughes, Michael Shoffner, Derek Hamner Manning Publications Company; ISBN 188477749X
That code is Copyright © 1997-1999 Merlin Hughes, Michael Shoffner, Derek Hamner; see jnp-license.txt (in jarfile) for details of its licensing.
The DummyDNS application and GUI were written by Lawrie Brown from ADFA, Canberra Australia. Lawrie's code is Copyright © 2005 by Lawrie Brown. Permission to reuse the code as desired is granted, provided due acknowledgement is given of the author and source of the original code.