<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi all, <br></div><div><br></div><div>I have a RPZ setup to whitelist several domains. <br></div><div>The issue I am facing is that, even though domains are blocked, the cashing DNS server still proceeds to resolve the domain. The bahavior that I was hoping to see is the server to not bother resolving the domain if the RPZ policy replies with NXDOMAIN (domain does not exist). <br></div><div><br></div><div>The bind I am running is 9.10.3. </div><div>I have the following configuration: <br></div><div><br></div><div><font size="1"><span style="font-family:monospace,monospace">options {<br>        directory "/var/cache/bind";<br>        allow-recursion { localhost; auth; };<br>        allow-query { localhost; };<br>        allow-transfer { "none"; };<br>        querylog yes;<br><br>        forwarders {<br>        208.67.222.222;<br>        208.67.220.220;<br>        <br>        };<br>        auth-nxdomain no;    # conform to RFC1035<br>        listen-on-v6 { any; };<br>};<br><br>view "lan" {<br>        match-clients { lan; };<br>        allow-query-cache { localhost; lan; };<br>        include "/etc/bind/named.conf.local";<br>        include "/etc/bind/named.conf.default-zones";<br><br>};</span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><br></span></font></div><div><font size="1"><font size="2">"lan" and "auth" are defined ACLs. </font><span style="font-family:monospace,monospace"><br></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><br></span></font></div><div><font size="1"><font size="2">The RPZ policies and zones are loaded from </font><font size="1"><font size="2">/etc/bind/named.conf.local, as below: </font></font><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">response-policy { zone "rpz-whitelist-lan"; zone "rpz-blackhole"; };<br>zone "rpz-whitelist-lan" {<br>        type master;<br>        file "/var/cache/bind/rpz-whitelist-lan.db";<br>        allow-query { none; };<br>        allow-transfer { none; };<br>};<br><br>zone "rpz-blackhole" {<br>        type master;<br>        file "/var/cache/bind/rpz-blackhole.db";<br>        allow-query { none; };<br>        allow-transfer { none; };<br>};<br><br></span></font></span></font></div><div><font size="1"><font size="2">The content of the rpz-whitelist-lan zone are: </font><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">$TTL    1<br>@       IN      SOA     localhost. root.localhost. (<br>                  2019021107         ; Serial<br>                      3H         ; Refresh<br>                      1H         ; Retry<br>                      1W         ; Expire<br>                      60 )       ; Negative Cache TTL<br><br><br>        IN    NS localhost.<br><br>; whitelist<br><a href="http://google.com">google.com</a>                   IN      CNAME   rpz-passthru.<br><a href="http://eset.com">eset.com</a>                 IN      CNAME   rpz-passthru.<br><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"></span></font>while the content of the <font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">rpz-blackhole is: <br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">$TTL 60<br>@            IN    SOA  localhost. root.localhost.  (<br>                     2019021107    ; serial<br>                     3H        ; refresh<br>                     1H        ; retry<br>                     1W        ; expiry<br>                     1H)    ; minimum<br><br>             IN      NS    localhost.<br><br>*                    CNAME .<br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="2">The configuration is ok, and the whitelisting is functioning as expected, but I see that the DNS server still generates DNS traffic when querying domains that are not listed in the whitelist, while the client correctly received "domain does not exist". <br></font></div><div><font size="2"><br></font></div><div><font size="2">Is this expected behaviour? Is there any way to make the server avoid proceeding with the resolution, when the initial client requests is blocked? <br></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace"><br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">Thanx, <br></span></font></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><font size="1"><span style="font-family:monospace,monospace">Alex<br></span></font></span></font></div><div><br></div></div></div></div></div></div>