DNS Resolver (Unbound) Python Integration
Add the python module integration to the DNS Resolver (Unbound)
The only remaining function, would be to mount the /bin and /lib folders to the /var/unbound folder.
mkdir -p /var/unbound/usr/local/bin mkdir -p /var/unbound/usr/local/lib mount_nullfs -o ro /usr/local/bin/ /var/unbound/usr/local/bin mount_nullfs -o ro /usr/local/lib/ /var/unbound/usr/local/lib
I have coded the following for pfBlockerNG for testing purposes, but this will need to be adapted for pfSense and called at bootup before Unbound starts or it will fail to load without the mounts. It will also need notices/log info message code added.
Updated by BBcan177 . about 3 years ago
The final code for mounting the /bin and /lib folders has been submitted for review (Services.inc):
Updated by Jim Pingle about 2 years ago
This doesn't appear to be working on 2.4.5.
On 2.5.0 I can copy over netflix-no-aaaa.py (attached) and enable the module, select the script, and it works as expected (resolving netflix.com only returns A records. Without the script, both A and AAAA records are returned).
On 2.4.5, using the same actions, unbound fails to run. Unbound quits without logging any errors. Starting it manually in the foreground results in an error:
/usr/local/sbin/unbound -d -c /var/unbound/unbound.conf Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python
Updated by DRago_Angel [InV@DER] almost 2 years ago
About python module and python files, suggestion "option two":
add Notice *(i) to Python Module Script about:
1. If you want to add Python Modules and backup them install Filer Plugin
2. Put Python Modules in /var/unbound folder with 644 permissions with root:root owner
3. In case of usage Filer Plugin you can reload Unbound with Shell command in Filer on update/sync of file:
unbound-control -c /var/unbound/unbound.conf reload