<<< Date Index >>>     <<< Thread Index >>>

Re: Permitting recursion can allow spammers to steal name server resources



Chris Brenton <cbrenton@xxxxxxxxxxxxxxxx> wrote:
> Changing Bind so that it will not act recursively for all hosts on the 
> Internet is a relatively simple process. Edit the /etc/named.conf file 
> to add in the "allow-recursion" parameter similar to the following:
> 
> options {
>         directory "/var/named";
>         allow-recursion {localnets; };
> };
> 
>                                           All other subnets however will 
> be blocked from doing recursive queries. Users on the Internet will only 
> be permitted to look up information you are authoritative for (like your 
> Web server's IP address, your MX record, etc.).

That's not entirely true.  BIND (9, at least) is still vulnerable
to cache poisoning by local users, after which it will serve up the
cached answers to anyone that can query (not just recursion-authorized
clients.)  Try looking up a domain you aren't authoritative for from a
recursion-authorized client, then from an unauthorized one.  You'll get
the cached answer with the unauthorized client.  Of course, given an ISP
or corporation, it's trivial to make one of their users look up your
hostname.

The rationale, as I understand it, is that returning a cached answer
doesn't require recursion, so allow-recursion doesn't apply.

The proper way to avoid this problem is to configure BIND to deny all
queries except ones you specifically want to answer:

options {
    allow-query { localnets; };
    allow-recursion { localnets; };
};

zone "example.com" {      # An authoritative zone
    allow-query { any; };
    # other example.com statements
};

Mark