<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">This is what I have:<div class=""><br class=""></div><div class=""><div class="">server:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>verbosity: 1</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>statistics-cumulative: "yes"</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>extended-statistics: "yes"</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>num-threads: 2</div><div class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>interface: "0.0.0.0"</div><div class=""> interface: "::0"</div><div class=""> interface-automatic: yes</div><div class=""> outgoing-port-permit: "32768-65535"</div><div class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>outgoing-port-avoid: "0-32767"</div><div class=""> chroot: ""</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>root-hints: "/etc/unbound/root.hints"</div><div class=""> module-config: "validator python iterator"</div><div class=""> directory: "/etc/unbound"</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>cache-max-ttl: 300</div><div class=""> log-queries: no</div><div class=""> do-not-query-localhost: no</div><div class=""> include: /etc/unbound/unbound.local.d/*.conf</div><div class="">python:</div><div class=""> python-script: "/etc/unbound/dns-backend.py"</div><div class="">remote-control:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>control-enable: yes</div><div class="">include: "/etc/unbound/unbound.conf.d/*.conf"</div><div class=""><br class=""></div><div>Here's what I see when I try to run unbound:</div><div><br class=""></div><div><div>unbound -dv -c unbound.conf</div><div>[1540500365] unbound[18398:0] notice: Start of unbound 1.6.0.</div><div>Traceback (most recent call last):</div><div> File "<string>", line 1, in <module></div><div>ImportError: No module named 'unboundmodule'</div><div class=""><br class=""></div><div class="">However, it's there:</div><div class=""><br class=""></div><div class=""><div class="">ll /usr/lib/python2.7/dist-packages/ | grep unbound</div><div class="">-rw-r--r-- 1 root root 102230 Aug 27 2017 unboundmodule.py</div><div class="">-rw-r--r-- 1 root root 85737 Oct 19 15:05 unboundmodule.pyc</div><div class="">-rw-r--r-- 1 root root 36348 Aug 27 2017 unbound.py</div><div class="">-rw-r--r-- 1 root root 39760 Oct 19 15:05 unbound.pyc</div><div class="">-rw-r--r-- 1 root root 80016 Aug 27 2017 _unbound.x86_64-linux-gnu.so</div></div><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class="">On Oct 25, 2018, at 6:00 AM, <a href="mailto:unbound-users-request@nlnetlabs.nl" class="">unbound-users-request@nlnetlabs.nl</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Date: Wed, 24 Oct 2018 14:38:00 +0200</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">From: George Thessalonikefs <</span><a href="mailto:george@nlnetlabs.nl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">george@nlnetlabs.nl</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">To:<span class="Apple-converted-space"> </span></span><a href="mailto:unbound-users@nlnetlabs.nl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">unbound-users@nlnetlabs.nl</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Subject: Re: unbound v1.6.0 python module on debian 9</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Message-ID: <</span><a href="mailto:b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Content-Type: text/plain; charset=utf-8</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hi Christopher,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">What is the error you are getting from unbound?</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Can you share some bits of your configuration file? I am mainly</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">interested in the following options:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> chroot:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> directory:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> module-config:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> python-script:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">-- George</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 24/10/2018 14:29, Christopher Hearn via Unbound-users wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Thanks for the reply George. ?When I run what you suggested, I see<br class="">/usr/lib/python2.7/dist-packages, and the unboundmodule.py is indeed in<br class="">there. ?If I run my python script on it?s own from my shell, it works<br class="">fine. ?unbound itself still does not see it, nor any of the other<br class="">dependencies in that directory. ?Any idea why this might be?<br class=""><br class=""><blockquote type="cite" class="">On Oct 24, 2018, at 6:00 AM,<span class="Apple-converted-space"> </span><a href="mailto:unbound-users-request@nlnetlabs.nl" class="">unbound-users-request@nlnetlabs.nl</a><br class=""><<a href="mailto:unbound-users-request@nlnetlabs.nl" class="">mailto:unbound-users-request@nlnetlabs.nl</a>> wrote:<br class=""><br class="">Date: Tue, 23 Oct 2018 18:13:23 +0200<br class="">From: George Thessalonikefs <<a href="mailto:george@nlnetlabs.nl" class="">george@nlnetlabs.nl</a><br class=""><<a href="mailto:george@nlnetlabs.nl" class="">mailto:george@nlnetlabs.nl</a>>><br class="">To:<a href="mailto:?unbound-users@nlnetlabs.nl" class="">?unbound-users@nlnetlabs.nl</a><span class="Apple-converted-space"> </span><<a href="mailto:unbound-users@nlnetlabs.nl" class="">mailto:unbound-users@nlnetlabs.nl</a>><br class="">Subject: Re: unbound v1.6.0 python module on debian 9<br class="">Message-ID: <<a href="mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl" class="">014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl</a><br class=""><<a href="mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl" class="">mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl</a>>><br class="">Content-Type: text/plain; charset=utf-8<br class=""><br class="">Hi Christopher,<br class=""><br class="">On 23/10/2018 17:24, Christopher Hearn via Unbound-users wrote:<br class=""><blockquote type="cite" class="">I?m trying to set up a server running unbound and a python script.<br class="">?This is working OK on an older server running version 1.4.2. ?On the<br class="">newer one, I can?t seem to get unbound to see the python script<br class="">dependencies. ?I do recall on the old server, this was because chroot<br class="">was enabled. ?Once I disabled it in the config file via chroot: ??,<br class="">it was fine. ?It?s disabled on the new one too, but still doesn?t<br class="">seem to help. ?If I symlink the requested file from<br class="">/usr/lib/python2.7/dist-packages/unboundpython.py to /etc/unbound/,<br class="">that resolves that error, but more come up because of course it can?t<br class="">see the other libraries. ?This leads me to believe that unbound isn?t<br class="">looking out of /etc/unbound/ even though chroot is disabled. ?Is<br class="">there something else I?m missing?<br class=""><br class=""></blockquote><br class="">I am assuming that you want to use a python script with unbound's python<br class="">module.<br class=""><br class="">I see that when initializing the python module, unbound appends to the<br class="">sys path also the directory reported by Python as the<br class="">"platform-dependent include directory" [1].<br class=""><br class="">You can find that directory by starting up the Python interpreter (the<br class="">same that unbound will also use; in case of Python virtual environments)<br class="">and typing:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">import distutils.sysconfig<br class="">distutils.sysconfig.get_python_lib(1,0)<br class=""></blockquote></blockquote>'/usr/local/lib/python2.7/site-packages' (in my case)<br class=""><br class="">As a side note you can also achieve the same with chroot enabled but<br class="">then you would need to link the same python directory structure inside<br class="">the chroot in order for unbound to find the libraries.<br class=""><br class="">[1]<br class=""><a href="https://docs.python.org/3.7/distutils/apiref.html?highlight=get_python_lib#distutils.sysconfig.get_python_lib" class="">https://docs.python.org/3.7/distutils/apiref.html?highlight=get_python_lib#distutils.sysconfig.get_python_lib</a><br class=""><br class="">-- George<br class=""></blockquote><br class=""></blockquote><br class="Apple-interchange-newline"></div></blockquote></div><br class=""></div></body></html>