[MaraDNS list] How to use execfile("filename") in Deadwood

Sam Trenholme maradns at gmail.com
Sat Dec 10 23:15:56 EST 2011


Also at http://maradns.org/deadwood/doc/execfile-HOWTO.html

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.

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, 192.228.79.201, 192.33.4.12, 128.8.10.90,"
root_servers["."]+="192.203.230.10, 192.5.5.241, 192.112.36.4, 128.63.2.53, "
root_servers["."]+="192.36.148.17, 192.58.128.30, 193.0.14.129, 199.7.83.42, "
root_servers["."]+="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)

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, 192.228.79.201, 192.33.4.12, 128.8.10.90,"
root_servers["."]+="192.203.230.10, 192.5.5.241, 192.112.36.4, 128.63.2.53, "
root_servers["."]+="192.36.148.17, 192.58.128.30, 193.0.14.129, 199.7.83.42, "
root_servers["."]+="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.


More information about the list mailing list