<div dir="auto">Thank you very much for both answers.<div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">El 11 abr. 2017 19:17, "Chris Buxton" <<a href="mailto:clists@buxtonfamily.us">clists@buxtonfamily.us</a>> escribió:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="elided-text"><div><blockquote type="cite"><div>On Apr 11, 2017, at 2:19 AM, Manuel Ramírez <<a href="mailto:manuel.ramirez@grupoica.com" target="_blank">manuel.ramirez@grupoica.com</a>> wrote:</div><br class="m_8930067437376030693Apple-interchange-newline"><div><div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br></div>I would like to allow queries for specific <a href="http://blogspot.com/" target="_blank">blogspot.com</a> subdomains and block the rest of the queries.<br></div><div>I have a file with several zones configured, one of those zones is  the specific subdomain type "forward":<br><br></div><i>zone "<a href="http://w.blogspot.com/" target="_blank">w.blogspot.com</a>" IN { type forward; forwarders { 213.0.184.85; 213.0.184.88; };};</i><br><br></div>and below i have the zone <a href="http://blogspot.com/" target="_blank">blogspot.com</a> as master resolving an internal ip:<br><br><i>zone "<a href="http://blogspot.com/" target="_blank">blogspot.com</a>" IN { type master; file "/var/named/data/db.sinkhole"; };</i><br><br><br></div>But is not working, always resolves the internal ip address, i thought it evaluates the zones in order and first should forward the query for <a href="http://w.blogspot.com/" target="_blank">w.blogspot.com</a> but is always matching the other zone.<br></div>Any idea about how can i achieve my goal?<br></div></div></div></div></blockquote></div><br></div><div>No, order is not considered. Rather, there are two separate searches:</div><div><br></div><div>- Is there an authoritative answer available from local data? In this case, yes, because you have a sinkhole zone named "<a href="http://blogspot.com" target="_blank">blogspot.com</a>", from which an authoritative negative answer can be derived.</div><div>- If the first search does not return an answer, then use the recursion algorithm, including checking the cache and checking for the most specific forwarding configuration (if any) that would apply.</div><div><br></div><div>Doing what you want is better solved using RPZ, as Tony Finch mentioned. To do this, do not define these two zone statements. Instead, define a response policy zone that says that *.<a href="http://blogspot.com" target="_blank">blogspot.com</a> should be blocked, but that specific names (e.g. <a href="http://w.blogspot.com" target="_blank">w.blogspot.com</a>) should be whitelisted. Read the BIND v9 ARM for details on how to accomplish this.</div><div><br></div><div>Regards,</div><div>Chris Buxton</div></div></blockquote></div><br></div>