<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 15, 2020 at 12:22 PM Chris Palmer via bind-users <<a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ondřej<br>
<br>
At first glance your suggestion looked like what I had done. But...<br>
I used:<br>
<br>
view "a" {<br>
   match-clients { 172.16.n.n/24; }<br>
   allow-recursion { any; };<br>
   zone "x.y.zzz" {<br>
     type static-stub;<br>
     server-addresses {<br>
       10.n.n.n;<br>
       10.n.n.m;<br>
     };<br>
   };<br>
};<br>
<br>
If the 10.n.n.n addresses are not reachable, it still recurses and does <br>
a public query resulting in an NXDOMAIN. However, I don't know what I <br>
have done differently this time, but the NXDOMAIN is no longer being <br>
cached. Each attempt causes it to query upstream, and when I bring the <br>
VPN up it uses the 10.n.n.n server correctly. Which is acceptable, <br>
although I'm still unsure why it is recursing at all (or at least why I <br>
can't prevent it).<br>
<br>
Out of curiosity I then changed to what you suggested:<br>
<br>
view "a" {<br>
   match-clients { 172.16.n.n/24; }<br>
   allow-recursion { any; };<br>
   zone "x.y.zzz" {<br>
     type static-stub;<br>
     server-names {<br>
       "10.n.n.n";<br>
       "10.n.n.m";<br>
     };<br>
   };<br>
};<br>
<br>
This ALWAYS gives a SERVFAIL though regardless of whether the 10.n.n.n <br>
addresses are reachable or not...<br></blockquote><div><br></div><div>"server-names" must be given a list of NAMES, not addresses.  "10.n.n.n" is probably not the right name, looks more like an address.</div><div><br></div><div>-- </div><div>Bob Harold</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So I have something that works, although it is sub-optimal when the VPN <br>
is down.<br>
<br>
Cheers, Chris<br>
<br>
On 15/05/2020 14:26, Ondřej Surý wrote:<br>
> Hi Chris,<br>
> <br>
> why don’t you just delegate the x.y.zzz to the server in the VPN?<br>
> <br>
> Generally, the static-stub should work in this case, but your email doesn’t have<br>
> enough details why it would not.<br>
> <br>
> I properly get SERVFAILs with this minimal config:<br>
> <br>
> zone "<a href="http://sury.org" rel="noreferrer" target="_blank">sury.org</a>" {<br>
>    type static-stub;<br>
>    server-names {<br>
>      "192.168.1.1";<br>
>    };<br>
> };<br>
> <br>
> and named -g reports:<br>
> <br>
> 15-May-2020 15:25:00.015 network unreachable resolving '<a href="http://192.168.1.1/A/IN" rel="noreferrer" target="_blank">192.168.1.1/A/IN</a>': 2001:503:c27::2:30#53<br>
> 15-May-2020 15:25:00.015 network unreachable resolving '<a href="http://192.168.1.1/AAAA/IN" rel="noreferrer" target="_blank">192.168.1.1/AAAA/IN</a>': 2001:503:c27::2:30#53<br>
> <br>
> Cheers,<br>
> Ondrej<br>
> --<br>
> Ondřej Surý<br>
> <a href="mailto:ondrej@isc.org" target="_blank">ondrej@isc.org</a><br>
> <br>
>> On 15 May 2020, at 14:40, Chris Palmer <<a href="mailto:chris9@cpalmer.me.uk" target="_blank">chris9@cpalmer.me.uk</a>> wrote:<br>
>><br>
>> Hi Ondřej<br>
>><br>
>> That could work for eliminating the caching delay when the VPN comes up. I'd just have to get that into the VPN config so people didn't have to do it manually.<br>
>><br>
>> Is there any way to stop the recursion for that domain happening in the first place though?<br>
>><br>
>> Thanks, Chris<br>
>><br>
>><br>
>> On 15/05/2020 13:34, Ondřej Surý wrote:<br>
>>> Hi Chris,<br>
>>> when your vpn comes up, you need to issue:<br>
>>> rndc flushtree <domain><br>
>>> command to the BIND 9 instance.<br>
>>> Ondrej<br>
>>> --<br>
>>> Ondřej Surý<br>
>>> <a href="mailto:ondrej@isc.org" target="_blank">ondrej@isc.org</a><br>
>>>> On 15 May 2020, at 14:16, Chris Palmer via bind-users <<a href="mailto:bind-users@lists.isc.org" target="_blank">bind-users@lists.isc.org</a>> wrote:<br>
>>>><br>
>>>> There is much discussion about recursion but I can't find anything that matches this use case...<br>
>>>><br>
>>>> - In-house Bind-9.11.14 server, master for some local zones, recursion enabled; not accessible from external networks<br>
>>>> - Two views for in-house networks<br>
>>>> - Intermittent VPN access from in-house network to another private network that is master for DNS zone x.y.zzz; this network is not publicly reachable<br>
>>>> - Need queries from one of our views for x.y.zzz to be sent to the static address for the x.y.zzz server that is only reachable via the VPN<br>
>>>> - When the VPN is not connected, need the lookup on to fail/timeout rather than go through the recursion path<br>
>>>> - When the VPN is again connected need lookups to succeed without undue delay.<br>
>>>><br>
>>>> Within the required view I have tried a zone with type forward (specifying forwarders and forward only), and also a zone of type static-stub (specifying server-addresses). Both work fine when the VPN is up. Both have two problems though when the VPN is disconnected:<br>
>>>>        (a) the queries are recursed and an NXDOMAIN response cached.<br>
>>>>        (b) When the VPN comes back up the cached NXDOMAIN is served until it expires.<br>
>>>><br>
>>>> I have been trying to force a SERVFAIL when the specified servers for that domain are unreachable, rather than recursing. And presumably that would then cause the queries to quickly flow to the required servers once they are reachable again. Is that possible, or is there another approach to this problem?<br>
>>>><br>
>>>> Many thanks, Chris<br><br>
</blockquote></div></div>