The execfile mechanism allows one to have Deadwood include another file in the dwood3rc configuration file.

For example, let us suppose we want to have a file with a list of domains to be solved by a name server for the Open NIC project. We want to make this an external file, since this information will probably have to be updated more frequently than other configuration data in our dwood3rc file (located at /etc/dwood3rc).

First, Deadwood requires that the directory /etc/deadwood/execfile exists:

$ mkdir /etc/deadwood/
$ mkdir /etc/deadwood/execfile/

This directory should be owned by root.

Now, let's take a simple dwood3rc file:

bind_address = "127.0.0.1,192.168.42.101"
recursive_acl = "127.0.0.0/16,192.168.42.0/24"
chroot_dir = "/etc/deadwood"
root_servers = {}
root_servers["."]="198.41.0.4, 199.9.14.201, 192.33.4.12, 199.7.91.13,"
root_servers["."]+="192.203.230.10, 192.5.5.241, 192.112.36.4, "
root_servers["."]+="198.97.190.53, 192.36.148.17, 192.58.128.30, "
root_servers["."]+="193.0.14.129, 199.7.83.42, 202.12.27.33"
upstream_servers = {}

We now make a file pointing to a recursive server used by the Open NIC project:

$ cat > /etc/deadwood/execfile/opennicproject
upstream_servers["bit."] = "178.32.31.41"
upstream_servers["glue."] = "178.32.31.41"
upstream_servers["geek."] = "178.32.31.41"
upstream_servers["free."] = "178.32.31.41"
upstream_servers["indy."] = "178.32.31.41"
upstream_servers["parody."] = "178.32.31.41"
upstream_servers["bbs."] = "178.32.31.41"
upstream_servers["fur."] = "178.32.31.41"
upstream_servers["null."] = "178.32.31.41"
upstream_servers["oss."] = "178.32.31.41"
upstream_servers["ing."] = "178.32.31.41"
upstream_servers["dyn."] = "178.32.31.41"
upstream_servers["gopher."] = "178.32.31.41"
upstream_servers["micro."] = "178.32.31.41"

(At this point hit Ctrl + D at the beginning of a blank line to end the file)

In plain English, the above lines tell Deadwood to have names ending in ".bit", ".glue" (such as "opennic.glue"), ".geek", ".free", and so on be recursively resolved by the DNS server with the IP 178.32.31.41.

This file needs to be referred to by Deadwood, so let's edit the dwood3rc file to refer to it:

bind_address = "127.0.0.1,192.168.42.101"
recursive_acl = "127.0.0.0/16,192.168.42.0/24"
chroot_dir = "/etc/deadwood"
root_servers = {}
root_servers["."]="198.41.0.4, 199.9.14.201, 192.33.4.12, 199.7.91.13,"
root_servers["."]+="192.203.230.10, 192.5.5.241, 192.112.36.4, "
root_servers["."]+="198.97.190.53, 192.36.148.17, 192.58.128.30, "
root_servers["."]+="193.0.14.129, 199.7.83.42, 202.12.27.33"
upstream_servers = {}
execfile("opennicproject")
That's all there is to it. Now, Deadwood will read the contents of the /etc/deadwood/execfile/opennicproject file as if it were part of the dwood3rc file.