OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: drewhemm on May 06, 2021, 05:46:03 PM

Title: Private domains with Unbound DNS
Post by: drewhemm on May 06, 2021, 05:46:03 PM
Hi,

I am observing some strange behaviour with Unbound DNS: I have added a domain override for a domain I am using solely within my local network, let's call it h.example.com. What I want is for queries for any subdomain records to be answered only by Unbound DNS, and not forwarded out to the Internet, as any responses coming back from outside will be incorrect.

The domain override for h.example.com goes to 192.168.1.1, which is the appliance LAN IP.

My DHCP hosts are correctly resolvable, but I am seeing mixed behaviour for host overrides: some resolve 100% of the time and others fail 100% of the time.

One thing that solves the resolution for all hosts is to go to the Miscellaneous page and enter my private domain in the 'Private Domains' field, then click 'Apply'. Once I do this, all my host overrides resolve correctly to addresses within my LAN.

But... if I then restart Unbound DNS, resolution for some of these overrides immediately begins to fail, until I go back to that Miscellaneous page and click 'Apply', even without making any changes.

I have also followed this tutorial (https://docs.opnsense.org/manual/unbound.html) on how to put an additional config file in the file system that contains my private domain, and I have verified that the config gets templated as expected, however this does not solve the problem.

Even clicking Apply on the Miscellaneous page, with no entries in Private Domains also fixes the issue. This may be because I have the config file in the system, not sure about that one.

My question now is, what does that 'Apply' button do, why it is able to fix these resolution issues, when everything else fails?
Title: Re: Private domains with Unbound DNS
Post by: drewhemm on May 06, 2021, 09:13:56 PM
I still don't know why the 'Apply' button temporarily fixes things, but I realised that I was only having problems with host overrides for IPs that were already in the system due to their being dished out via DHCP...

Creating overrides for other IPs works fine in all cases