<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
</HEAD>
<BODY>
<H1>Deadwood FAQ</H1>

<h2>INDEX</h2>
<BLOCKQUOTE>
1. <A href="#01">What is Deadwood?</A><p>
2. <A href="#02">How do I use Deadwood?</A><p>
3. <A href="#03">How do I convert a MaraDNS mararc file in to a 
                 Deadwood dwood3rc file?</A><p>
4. <A href="#04">I changed a configuration parameter but it has not 
		 affected Deadwood</A><p>
5. <A href="#05">Deadwood sends out a lot of queries</A><p>
6. <A href="#06">Steve Gibson's DNS benchmark reports that Deadwood 
                 is dropping a lot of DNS packets</A><p>
7. <A href="#07">Can Deadwood blacklist by name?</A><p>
8. <A href="#08">Does Deadwood have DNSSEC support?</A><p>
9. <A href="#09">Records added to the cache when the timestamp is set
                 to 1970 do not expire</A><p>
10. <A href="#10">I get the error message "Unknown dwood3rc string 
		 parameter"</A><p>
11. <A href="#11">Internal IPs (198.168.x.x, 10.x.x.x, 172.16.x.x, 
	127.x.x.x) do not resolve in Deadwood</A><p>
12. <A href="#12">I get the error message "Uninitialized dictionary 
	variable"</A><p>
</BLOCKQUOTE>

<A name="01"> </A>
<h2>What is Deadwood?</h2>

Deadwood is the recursive DNS daemon (service) for
MaraDNS 2.0.  MaraDNS 2.0 uses separate programs for
authoritative records (maradns) and recursive records (Deadwood).  
Deadwood is a standalone recursive server that can either be used
in conjunction with MaraDNS's authoritative server, or by itself.
The program can run either in Scientific Linux 6 (and hopefully other
Linux and *NIX flavors) or in Windows XP (as well as newer Windows
releases).

<p>

The reason for this rewrite is because I have never been satisfied with
the recursive resolver in MaraDNS 1.0.  When I designed MaraDNS 1.0's
recursive resolver, there were a number of things needed to get full
recursion to work that I did not anticipate.  By the time I shoehorned
in all of the features needed in a fully recursive DNS server, the code
was rather messy and difficult to maintain.

<p>

Ever since 2002, my plan has been to rewrite MaraDNS' recursive code.  
In the fall of 2007, I finally started making the code; the code
became MaraDNS' recursive resolver in the fall of 2010.

<A name="02"> </A>
<h2>How do I use Deadwood?</h2>

Create a configuration file, <tt>/etc/dwood3rc</tt>, that looks like this:

<pre>
bind_address="127.0.0.1"
recursive_acl="127.0.0.1/8"
chroot_dir="/etc/deadwood"
</pre>

Now, create an empty directory owned by root called <tt>/etc/deadwood</tt>.  
Once this is done, compile Deadwood (as per INSTALL.txt), and see if it runs.  
The above configuration file will only allow connections using the loopback
interface on the same machine to resolve domains with Deadwood.

<A name="03"> </A>
<h2>How do I convert a MaraDNS mararc file in to a Deadwood dwood3rc file?</h2>

While some effort has been made to have Deadwood use the same syntax and 
variables as MaraDNS, there are some differences to keep in mind:

<ul>

<li>Deadwood does not have a "ipv4_alias" parameter.  

<li>Deadwood handles "verbose_level" differently; to get fully verbose
    messages, "verbose_level" has to be 100 (as opposed to MaraDNS' 10)

</ul> 

<A name="04"> </A>
<h2>I changed a configuration parameter but it has not affected Deadwood</h2>

Be sure to delete the cache file when making any changes to Deadwood's
configuration.  In Windows, the cache file is called dw_cache_bin (unless
the dwood3rc.txt file is edited); in CentOS, with the default dwood3rc file,
the file is called dw_cache.

<A name="05"> </A>
<h2>Deadwood sends out a lot of queries</h2>

Deadwood will do this on a slow network, since the default parameters are
tuned to get a fast reply on a broadband internet connection.  On a slow
(dialup, saturated broadband, etc) connection, timeout_seconds should
have a value of 7 and num_retries should have a value of 1.  This is
done by adding the following lines to the dwood3rc file:

<pre>
timeout_seconds = 7
num_retries = 1
</pre>

<A name="06"> </A>
<h2>Steve Gibson's DNS benchmark reports that Deadwood is dropping a lot of 
    DNS packets</h2>

After running this tool and carefully looking at Deadwood's replies to 
Gibson's DNS benchmark tool, I can safely conclude that Gibson's tool is
buggy and that Deadwood is not dropping the packets being sent to it.
<p>

A much better tool to use is Namebench, which correctly shows that Deadwood
drops very few (if any) DNS packets sent to it.  Namebench is available at
available at http://code.google.com/p/namebench/

<A name="07"> </A>
<h2>Can Deadwood blacklist by name?</h2>

Yes; Deadwood can blacklist up to 500,000 names.
<p>

To blacklist a name, add a line like this to the dwood3rc file:

<pre>
ip4["scam.example.com."] = "X"
</pre>

Replace "scam.example.com." with the domain to be blacklisted.

<p>

Deadwood uses a hash to store these blacklisted domains, and is able
to store tens of thousands of such domains without significant slowdown.
<p>

If it is more convenient to store the domains in separate files, this can be
done using Deadwood's "execfile" mechanism.
<p>

Note that older versions of Deadwood needed to increase the
maximum_cache_elements value to store these; as of Deadwood 3.5.0004,
this is no longer true.

<A name="08"> </A>
<h2>Does Deadwood have DNSSEC support?</h2>

No.  I have nothing against DNSSEC per se, but I plain simply am not in a
position to take the time and effort to implement DNSSEC without being
compensated for my work.

<A name="09"> </A>
<h2>Records added to the cache when the timestamp is set to 1970 do not
expire</h2>

This bug was fixed in Deadwood 3.2.02; Deadwood now rejects entries
in the hash that expire in the far future.  The issue was that,
on non-Windows systems with 32-bit time_t, 1970
to Deadwood looks like the far future to make the 
program Y2038-compliant (The Windows port, while a 32-bit binary,
gets its time from 64-bit timestamps since 2011).

<A name="10"> </A>
<h2>I get the error message "Unknown dwood3rc string parameter"</h2>

This error message indicates either one of two things:

<ul>
<li>The relevant parameter is misspelled.  For example, if one has a line
like this in their dwood3rc file:

<pre>
bind_adress = "127.0.0.1"
</pre>

This error message will appear.  To fix it, correct the spelling of
the variable name:

<pre>
bind_address = "127.0.0.1"

</li>
<li>The relevant parameter is a numeric parameter, but has quotes around it.  
For example, the following line will trigger this error message:

<pre>
filter_rfc1918 = "0"
</pre>

To correct this, remove the quotes around the number:

<pre>
filter_rfc1918 = 0
</pre>

</li>
</ul>

For the record, all dwood3rc parameters <i>except</i> the following are 
numeric parameters:

<ul>
<li>bind_address 
<li>cache_file
<li>chroot_dir
<li>ip_blacklist
<li>ipv4_bind_addresses
<li>random_seed_file
<li>recursive_acl
<li>root_servers 
<li>upstream_servers
</ul>

<A name="11"> </A>
<h2>Internal IPs (198.168.x.x, 10.x.x.x, 172.16.x.x, 127.x.x.x) do not 
    resolve in Deadwood</h2>

Deadwood, by default, filters out RFC1918 and other non-routable IPs from
DNS replies, namely IPs in the form: 192.168.x.x, 172.[16-31].x.x, 10.x.x.x,
127.x.x.x, 169.254.x.x, 224.x.x.x, and 0.0.x.x.  

<p>

To disable this behavior, so that Deadwood can resolve internal and
other non-routable IPs, add this line to the Dwood3rc file:

<pre>
filter_rfc1918 = 0
</pre>

Note that some routers filter DNS packets with non-routable IPs.  Dave
Owens, for example, 
<A href="http://serverfault.com/questions/513608/maradns-does-not-respond-to-a-record-queries-of-locally-connected-rfc1918-addres/516464#516464">had
this problem</A>.

<A name="12"> </A>
<h2>I get the error message "Uninitialized dictionary variable"</h2>

When setting either upstream_servers or root_servers, be sure to
precede it with a line like this:

<pre>
upstream_servers = {}
</pre>

or

<pre>
root_servers = {}
</pre>

For example, if a line like this causes the uninitialized dictionary variable
error:

<pre>
upstream_servers["."]="8.8.8.8, 8.8.4.4"
</pre>

Add a line so it looks like this:

<pre>
upstream_servers = {}
upstream_servers["."]="8.8.8.8, 8.8.4.4"
</pre>

</BODY>
