Deadwood is a non-recursive DNS cache that is supported for two platforms: Windows XP (via MinGW) and CentOS Linux version 5. This program may or may not work on other platforms, but will not be supported on any other platform without some kind of support deal made. Note that while I do not fully support Deadwood on Vista nor Windows 7, there is a supplied document (doc/Windows/Vista.txt) that describes one way to get Deadwood to run in Vista and Windows 7. The rest of this document deals with how to compile this code in CentOS 5, followed by a section on how to compile this code in Windows XP. ==CENTOS 5== To compile this program in CentOS 5, first set the environmental variable FLAGS to the flags you wish to give the compiler. For example, with gcc, you probably want to make the compile-time flags "-O3" unless you are making this as small as possible for an embedded system. To set tha flags to be "-O3" using a POSIX-compliant shell (Bash, ash, etc.): export FLAGS='-O3' Once the compile-time flags are set, the next step is to compile the program. If in CentOS 5, enter the src directory and use 'make' to do this: cd src/ make -f Makefile.centos5 There is a single program compiled, DwMain. Place this program where it can be used. For example, to place this program in the directory /usr/local/bin, as root: cp DwMain /usr/local/bin cd /usr/local/bin ln -s DwMain DwTcp Return back to the directory with this file. The next step is to install the man page for DwMain and DwTcp. Here is one way to do this as root: cd doc/ cp DwMain.1 /usr/local/share/man/man1 Of course, you may want to start up this program and run it as a daemon when the system starts up. First, look at the text file dwood2rc (in the doc/ directory) and edit it. Then, make this file /etc/dwood2rc. For example: nano -w dwood2rc cp dwood2rc /etc You will also want to make a directory for Deadwood. This is the chroot_dir parameter in the dwood2rc file, and by default points to /etc/deadwood: mkdir /etc/deadwood chown 99:99 /etc/deadwood DwMain doesn't have any daemonization capability; this is handled by a separate program I wrote for MaraDNS, 'duende'. This program is in the tools/ directory, and needs to be compiled separately from DwMain and DwTcp. cd tools/ make cp duende /usr/local/bin mkdir /etc/maradns mkdir /etc/maradns/logger The directory /etc/maradns/logger is needed for duende to run. Now, you will want to edit your system start-up scripts to start up DwMain. To do this in CentOS 5, make a file with the name /etc/init.d/deadwood with the following content: #!/bin/sh case "$1" in start) /usr/local/bin/duende /usr/local/bin/DwMain ;; stop) killall DwMain ;; esac # End of startup script Make sure /etc/init.d/deadwood can be run as a program: chmod 755 /etc/init.d/deadwood Then, you will want to have this script be run at system boot time: cd /etc/rc.d/rc3.d/ ln -s ../init.d/deadwood S61deadwood cd /etc/rc.d/rc5.d/ ln -s ../init.d/deadwood S61deadwood Note that system startup is variable between distributions and the above steps may not work if you're not using CentOS 5. If you wish help with using Deadwood with another version of Linux or *NIX, send me an email and we'll discuss rates. Or send an email to the MaraDNS list and someone may or may not help you. It is possible to compile Deadwood with IPv6 support, or with caching disabled (which makes the binary a little smaller, for really tiny embedded systems). See the file doc/compile.options for details ==WINDOWS XP== To compile this program in Windows XP, you will need MinGW-3.1.0-1 and MSYS-1.0.10. I have a blog entry about obtaining and installing this software here: http://maradns.blogspot.com/2009/03/mingw-310-1-last-real-mingw-release.html Once MinGW is set up, to compile the Deadwood service, enter the follwing directory and enter the following commands: export FLAGS=-O3 make -f Makefile.mingw310 Once this is done, there will be a file called Deadwood.exe, which is a Windows service. First, find a suitable directory on your file system to install Deadwood, such as "c:\Program Files\Deadwood\" Once Deadwood.exe is placed in this directory, install the services: Deadwood install all Before you can run the service, you will need a file named "dwood2rc.txt" for Deadwood to read its parameters from in the same directory Deadwood.exe was placed. An example file is in doc/dwood2rc.mingw You will want to edit this file so that it points to working recursive DNS servers (such as the servers your ISP uses). You should also make a file with random text in it called secret.txt. Once these two files are in place, and properly configured, Deadwood can be started: net start Deadwood net start DeadwoodTCP (You can also start it from Control Panel -> Administrative Tools -> Services) Deadwood, at this point, should automatically start whenever the system is booted. Deadwood uses a file to store messages called "dwlog.txt" (without the quotes) in the same directory where Deadwood is started. If there are any errors that make it so Deadwood can not start, they should be noted in this log file. The DeadwoodTCP service logs information in a file called "dwtcplog.txt" To stop Deadwood: net stop Deadwood net stop DeadwoodTCP (Or from the Services control panel if you prefer mousing it) Deadwood will write its cache to a file (if specified) when stopped as a service. The DeadwoodTCP service is a non-caching service that provides basic DNS-over-TCP support; the Deadwood service provides caching and the much more commonly used DNS-over-UDP support. It should be possible to remove the Deadwood service: Deadwood remove all If one wishes to uninstall Deadwood.