Unbound adds all local IPs to hostname query

Started by Phiwatec, February 18, 2022, 11:59:02 AM

Previous topic - Next topic
Hi,
I'm using Unbound  as my DNS. The problem is, that when I query the opnsense hostname (router.lan.example.com) it returns all  IPs from the opnsense interfaces. This means, that I sometimes get the WAN or VPN IP which will cause a timeout. How can I prevent Unbound from appending these IPs to the query?
The DNS entry is public by the way.
Using the Hostname override function is not possible as the IP is dynamic.
Thank you in advance

Phiwatec

February 19, 2022, 10:17:08 AM #1 Last Edit: February 19, 2022, 10:24:36 AM by ajm
I'd like an answer to this too !

The only thing doing name resolution on my host is Unbound, and as you say it seems to be a hardcoded default somewhere to set up a FQDN/address binding on ALL Interfaces.

That's not the way I want my OPN host to look.

I want to have each interface with its own binding (fwd & rev) like <ifname>.<fqdn> so that things like traceroute return more useful info. For the main FQDN binding, I use a new Loopback interface (which is always up).

I've gone through all the Unbound GUI settings and can't see anything relevant.

Can anyone advise ?



February 19, 2022, 10:35:51 AM #2 Last Edit: February 19, 2022, 02:12:38 PM by ajm
Ok, I got a workaround/fix for my 'use case'.

Per: https://forum.opnsense.org/index.php?topic=8753.msg39705#msg39705

Under 'Services:Unbound:General'

Select my new 'Lo1' interface as the only Interface to listen on. This has the effect of supressing the automatic creation of bindings for all Interfaces.

Under 'Services: Unbound DNS: Overrides', I have a binding like <ifname.localpart>.<domainname>  for each Interface.

The only remaining auto-generated binding for the hosts FQDN, is the /32 address I have configured on 'Lo1', in a prefix assigned to this host in the addressing plan, for this sort of purpose.

So OPN is now looking how I want it to :)

I've used a similar approach to interface name binding on numerous multihomed L3 devices over the years, if anyone can think of any drawbacks or potential unintended consequenes, please comment.