title: PowerDNS - DNSQuestion is always nil
body: <p>I have setup a PowerDNS (4.0.4-1+deb9u4) upon Debian 9 with a MySQL backend successfully and the system was resolving hosts correctly. I am attempting to add scripting to the recursor and have used the examples, <a href="https://github.com/PowerDNS/pdns/blob/master/pdns/recursordist/contrib/powerdns-example-script.lua" rel="nofollow noreferrer">Lua script examples</a>. I have pointed the pdns-resolver's conf correctly at my lua script, and I see my log statements print correctly, but I am consistently receiving an error regarding the <a href="https://doc.powerdns.com/recursor/lua-scripting/dq.html" rel="nofollow noreferrer">DNSQuestion</a> instance being empty for all of the example lua functions. </p>
  
  <p>For example: </p>
  
  <pre><code>function preresolve(dq)
      pdnslog("Got question for "..dq.qname:toString().." from "..dq.remoteaddr:toString().." to "..dq.localaddr:toString())
      return true;
  end
  </code></pre>
  
  <p>Results in :
  <code>STL error (a.root-servers.net/A from 127.0.0.1): Trying to cast a lua variable from "nil" to "b"</code> (meaning the DNSQuestion instance is null).</p>
  
  <p>Clearly the lua script is running, but for some reason, all the dq instances are empty. </p>
  
  <p>Is there anything that I may have misunderstood or am missing that would cause the parameter to be nil?</p>