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.
#1 Updated by BBcan177 . about 1 year ago
The final code for mounting the /bin and /lib folders has been submitted for review (Services.inc):
#6 Updated by Jim Pingle about 1 month 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