Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Describe the bug
The generated /var/unbound/unbound.conf contains a relative path for the python module that fails to resolve:
python:
python-script: unbound-dnsbl/dnsbl_module.py
While this script is for DNSBL it seems to be present whether the DNSBL is enabled or not.
This causes Unbound to fail silently.
The service starts but DNS forwarding does not fully work.
External domain queries return empty answers dispite the upstream DNS servers being reachable and functional.
To Reproduce
- Go to Services → Unbound DNS → Query Forwarding
- Configure forwarding to upstream DNS servers
- Click Apply
- SSH to router and run:
unbound-checkconf /var/unbound/unbound.conf
- See error:
error: pythonmod: can't open file unbound-dnsbl/dnsbl_module.py for reading
fatal error: bad config during init for python module
I suspect that only steps 4 & 5 are actually necessary.
Expected behavior
The generated unbound.conf could use an absolute path that resolves correctly:
python:
python-script: /var/unbound/unbound-dnsbl/dnsbl_module.py
Or the relative path should resolve correctly within the configured chroot environment.
Describe alternatives you considered
-
Manual edit: Editing /var/unbound/unbound.conf to use the absolute path /var/unbound/unbound-dnsbl/dnsbl_module.py passes validation, but configctl unbound restart regenerates the config with the broken relative path.
-
Disable DNSBL: Disabling the Blocklist feature should remove the python module directive thus allowing DNS forwarding to work correctly. This does not seem to have an effect on the python-script element.
-
Symlink: Creating a symlink to make the relative path resolve - not fully tested.
Screenshots
Config validation failure:
root@mesolab-router:~ # unbound-checkconf /var/unbound/unbound.conf
[1769108850] unbound-checkconf[71749:0] error: pythonmod: can't open file unbound-dnsbl/dnsbl_module.py for reading
[1769108850] unbound-checkconf[71749:0] fatal error: bad config during init for python module
Manual fix passes validation:
root@mesolab-router:~ # vi /var/unbound/unbound.conf # change to absolute path
root@mesolab-router:~ # unbound-checkconf /var/unbound/unbound.conf
unbound-checkconf: no errors in /var/unbound/unbound.conf
Restart reverts the fix:
root@mesolab-router:~ # configctl unbound restart
OK
root@mesolab-router:~ # unbound-checkconf /var/unbound/unbound.conf
[1769109579] unbound-checkconf[54582:0] error: pythonmod: can't open file unbound-dnsbl/dnsbl_module.py for reading
[1769109579] unbound-checkconf[54582:0] fatal error: bad config during init for python module
DNS symptom - query via Unbound returns empty:
root@mesolab-router:~ # drill @127.0.0.1 cloud.foo.edu
;; ANSWER SECTION:
(empty)
Direct query to upstream works:
root@mesolab-router:~ # drill @10.2.189.78 cloud.foo.edu
;; ANSWER SECTION:
cloud.foo.edu. 300 IN A 10.2.218.115
Generated config shows correct chroot but broken python path:
server:
chroot: /var/unbound
directory: /var/unbound
...
python:
python-script: unbound-dnsbl/dnsbl_module.py
Additional context
The forwarding configuration itself is correct:
forward-zone:
name: "."
forward-addr: 10.4.162.82
forward-addr: 10.2.189.78
The issue is isolated to the DNSBL python module path preventing Unbound from initializing properly.
As this interfers with the full processing of unbound.conf it may affect other settings from working as well.
Environment
OPNsense 25.7.11_2 (amd64)
Hardware:
Protectli
Model: V1410
Intel ® N5105 Quad Core CPU at 2.0 GHz
Intel® I226-V 2.5Gigabit Ethernet NIC
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
I have looked at the following issues and believe them to be different but they might be the result of not fully processing the unbound.conf :
Describe the bug
The generated
/var/unbound/unbound.confcontains a relative path for the python module that fails to resolve:While this script is for DNSBL it seems to be present whether the DNSBL is enabled or not.
This causes Unbound to fail silently.
The service starts but DNS forwarding does not fully work.
External domain queries return empty answers dispite the upstream DNS servers being reachable and functional.
To Reproduce
unbound-checkconf /var/unbound/unbound.confI suspect that only steps 4 & 5 are actually necessary.
Expected behavior
The generated
unbound.confcould use an absolute path that resolves correctly:Or the relative path should resolve correctly within the configured chroot environment.
Describe alternatives you considered
Manual edit: Editing
/var/unbound/unbound.confto use the absolute path/var/unbound/unbound-dnsbl/dnsbl_module.pypasses validation, butconfigctl unbound restartregenerates the config with the broken relative path.Disable DNSBL: Disabling the Blocklist feature should remove the python module directive thus allowing DNS forwarding to work correctly. This does not seem to have an effect on the python-script element.
Symlink: Creating a symlink to make the relative path resolve - not fully tested.
Screenshots
Config validation failure:
Manual fix passes validation:
Restart reverts the fix:
DNS symptom - query via Unbound returns empty:
Direct query to upstream works:
Generated config shows correct chroot but broken python path:
Additional context
The forwarding configuration itself is correct:
The issue is isolated to the DNSBL python module path preventing Unbound from initializing properly.
As this interfers with the full processing of unbound.conf it may affect other settings from working as well.
Environment
OPNsense 25.7.11_2 (amd64)
Hardware:
Protectli
Model: V1410
Intel ® N5105 Quad Core CPU at 2.0 GHz
Intel® I226-V 2.5Gigabit Ethernet NIC