I internally override an externally visible domain to be able to give
different answers with a config like:
stub-zone:
name: "example.com"
stub-addr: 10.1.2.3
stub-addr: 10.1.2.4
stub-prime: yes
I recently upgraded from Unbound 1.4.4 to 1.4.19 and after running for a few
hours was noticing that queries for foo.bar.example.com (an internal-only
name) started returning NXDOMAIN. When this happens, "dig -t ns
example.com" shows the external NS records.
It turned out that I had poorly configured a subdomain of example.com with a
lame delegation to itself, and Unbound would eventually stop talking to
10.1.2.3 and 10.1.2.4 because of this, claiming "debug: No more query
targets, attempting last resort". It then it does what the documentation
for "stub-first" claims, even though I don't have it enabled, and goes and
looks up the nameservers for "example.com" starting with the roots. Unfortunately, this means it starts answering queries using the external
nameservers instead of the internal ones.
Is this the expected behavior of stub-prime? It seems to be a change from
how it was behaving in Unbound 1.4.4.
Disabling stub-prime seems to fix this.
See the sanitized relevant snippet of unbound-host output below. I can send
a larger unsanitized chunk privately if this isn't enough.
Thanks!
-- Aaron