core: Unbound host overrides breaks when adding a wildcard entry
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
Describe the bug
Adding a DNS entry named * (wildcard) on a domain with an existing host override will be allowed by UI but will break Unbound initialization, thus making it immediately offline after applying the change.
According to the manual, wildcards should be accepted as host names for host overrides.
To Reproduce
Steps to reproduce the behavior:
- Go to ‘Services’, then ‘Unbound DNS’, then ‘Overrides’
- Click on ‘+’ button and add a new override
- Set host to “abc”, domain to “opnsense.com”, type A, IP address 127.0.0.1
- Save, then click Apply
- Unbound will be still running, validate running a
drill @routerip abc.opnsense.comto see that it returns an entry to 127.0.0.1 - Click on ‘+’ button and add a new override
- Set Host to ‘*’, domain to “opnsense.com”, type A, IP address ‘127.0.0.1’
- Save, then click Apply
- See that Unbound will stop and won’t start again unless you either remove that entry or all entries that are not wildcards for that domain and apply again
Expected behavior
Unbound should stay up, and a subsequent drill xyz.opnsense.com should return an entry to ‘127.0.0.1’.
Environment
I don’t think it’s relevant.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (4 by maintainers)
Commits related to this issue
- Services: Unbound DNS: General - ignore TXT records for wildcard host entries as this prevents unbound from starting, related to https://github.com/opnsense/core/issues/8051 Although the function is ... — committed to opnsense/core by AdSchellevis a year ago
- Services: Unbound DNS: General - ignore TXT records for wildcard host entries as this prevents unbound from starting See: https://github.com/opnsense/core/issues/8051 (cherry picked from commit 1f21... — committed to opnsense/core by AdSchellevis a year ago
Hi, can this be reopened? I know it’s probably a low priority issue right now, but it’s still relevant.
I find that crashing the DNS server is such an extreme outcome for a minor “innocent” change like configuring a domain wildcard, as present in the documentation.
I would add this warning to the docs while we don’t have a fix for this issue.
Ok FIX/Workaround is simple!! Switch off the TXT after that wildcards works again.
Hitting the same problem again in OPNSense 25.1.10. The help file or (i) button explains just use a * for a wildcard but it makes the unbound server stop working.
2025-07-05T10:44:30 | Critical | unbound | [11822:0] fatal error: Could not set up local zones | – | – | – | – | – 2025-07-05T10:44:30 | Error | unbound | [11822:0] error: local-data in redirect zone must reside at top of zone, not at *.staging.home.lan TXT “Staging K8S Ingress”
Adding the entry without wildcard fails to resolve.
❯ nslookup staging.home.lan 10.2.0.254 Server: 10.2.0.254 Address: 10.2.0.254#53
Name: staging.home.lan Address: 10.2.4.20
❯ nslookup aap.staging.home.lan 10.2.0.254 Server: 10.2.0.254 Address: 10.2.0.254#53
** server can’t find aap.staging.home.lan: NXDOMAIN
Just faced the same problem “same domain as the domain of the OPNsense device” as I have updated opensense now to the latest version.
But for sure in Version 1.14.0 unbound was working with wildcard and a specific host override:
And it is still working… so just add an override for opnsense