<div>Code:</div><div><br></div><div>void MyDnsBackend::lookup(const QType& qtype, const string& qdomain, DNSPacket* pkt, int zoneId)</div><div>{</div><div>  L << Logger::Info << "Domain: " << qdomain << " Code type: " << qtype.getCode() << endl;</div>
<div><br></div><div>  if(qtype.getCode() == QType::SOA || qtype.getCode() == QType::CNAME)</div><div>    return;</div><div><br></div><div>  if (boost::algorithm::starts_with(qdomain, "*"))</div><div>    return;</div>
<div> </div><div>  //else - handle request </div><div>  //...</div><div>}</div><div><br></div><div><br></div><div>pdns.conf:</div><div><br></div><div>cache-ttl=0</div><div>negquery-cache-ttl=0</div><div>query-cache-ttl=0</div>
<div>recursive-cache-ttl=0</div><div><br></div><div>launch=mybackend</div><div>module-dir=/usr/share/mods/</div><div><br></div><div>recursor=<a href="http://127.0.0.1:53">127.0.0.1:53</a></div><div><br></div><div>local-address=127.0.0.1</div>
<div>daemon=yes</div><div><br></div><div><br></div><div>Dig output:</div><div><br></div><div>; <<>> DiG 9.7.6-P1 <<>> -t A <a href="http://google.com">google.com</a> @<server-ip></div><div>;; global options: +cmd</div>
<div>;; Got answer:</div><div>;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41566</div><div>;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0</div><div><br></div><div>;; QUESTION SECTION:</div>
<div>;<a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">                    </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A</div><div><br></div><div>;; ANSWER SECTION:</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.3</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.7</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.0</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.1</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.8</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.4</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.14</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.5</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.2</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.6</div>
<div><a href="http://google.com">google.com</a>.<span class="Apple-tab-span" style="white-space:pre">             </span>300<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.194.32.9</div>
<div><br></div><div>;; Query time: 319 msec</div><div>;; SERVER: <server-ip>#53(<server-ip>)</div><div>;; WHEN: Tue Dec  4 08:55:27 2012</div><div>;; MSG SIZE  rcvd: 204</div><div><br></div><div><br></div><div>
pdns log output:</div><div><br></div><div>Dec  4 02:59:04 server pdns[27079]: PowerDNS 3.1 (C) 2001-2012 PowerDNS.COM BV (Nov 28 2012, 09:32:08, gcc 4.4.6 20120305 (Red Hat 4.4.6-4)) starting up</div><div>Dec  4 02:59:04 server pdns[27079]: PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.</div>
<div>Dec  4 02:59:04 server pdns[27079]: DNS Proxy launched, local port 16203, remote <a href="http://127.0.0.1:53">127.0.0.1:53</a></div><div>Dec  4 02:59:04 server pdns[27079]: Creating backend connection for TCP</div><div>
Dec  4 02:59:04 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:04 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: [MyDnsBackend] Backend initialization completed. MySQL client version = 5.1.66</div>
<div>Dec  4 02:59:33 server pdns[27079]: Start dnsfence backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: About to create 3 backend threads for UDP</div><div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div>
<div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div>
<div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div>
<div>Dec  4 02:59:33 server pdns[27079]: Start dns backend initialization...</div><div>Dec  4 02:59:33 server pdns[27079]: Done launching threads, ready to distribute questions</div><div>Dec  4 02:59:35 server pdns[29319]: Domain: <a href="http://google.com">google.com</a> Code type: 6</div>
<div>Dec  4 02:59:35 server pdns[29319]: Domain: com Code type: 6</div><div>Dec  4 02:59:35 server pdns[29319]: Domain:  Code type: 6</div><div><br></div><div><br></div><div>I log all incoming requests. pdns-3.1:</div><div>
<br></div><div>+----+----------+------------+---------------+------------+------+-----------+</div><div>| id  | logdate| utime    | ip            | query                          | type | times_met |</div><div>+----+----------+------------+---------------+------------+------+-----------+</div>
<div>| 18 | 20121204 | 1354586125 | <source ip>   | <a href="http://google.com">google.com</a> | SOA  |         1 |</div><div>| 19 | 20121204 | 1354586125 | <source ip>   | com            | SOA  |         1 |</div>
<div>| 20 | 20121204 | 1354586125 | <source ip>   |                   | SOA  |         1 |</div><div>+----+----------+------------+---------------+------------+------+-----------+</div><div>3 rows in set (0.03 sec)</div>
<div><br></div><div><br></div><div>The same request on pdns-2.9.22 server:</div><div><br></div><div>+-------+----------+------------+---------------+-------------------------+------+-----------+</div><div>| id    | logdate  | utime      | ip            | query                                     | type | times_met |</div>
<div>+-------+----------+------------+---------------+-------------------------+------+-----------+</div><div>| 63846 | 20121204 | 1354585324 | <source ip>   | <a href="http://google.com">google.com</a>              | A    |       187 |</div>
<div>+-------+----------+------------+---------------+-------------------------+------+-----------+</div><div><br></div><div><br></div><div>Another example:</div><div><br></div><div>; <<>> DiG 9.7.6-P1 <<>> <a href="http://facebook.com">facebook.com</a> @<server-ip></div>
<div>;; global options: +cmd</div><div>;; Got answer:</div><div>;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7639</div><div>;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0</div><div>
<br></div><div>;; QUESTION SECTION:</div><div>;<a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">                       </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A</div>
<div><br></div><div>;; ANSWER SECTION:</div><div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">               </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>66.220.152.16</div>
<div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">         </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.252.100.16</div>
<div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">         </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>66.220.158.16</div>
<div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">         </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>173.252.101.16</div>
<div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">         </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>69.171.229.16</div>
<div><a href="http://facebook.com">facebook.com</a>.<span class="Apple-tab-span" style="white-space:pre">         </span>174<span class="Apple-tab-span" style="white-space:pre"> </span>IN<span class="Apple-tab-span" style="white-space:pre">  </span>A<span class="Apple-tab-span" style="white-space:pre">   </span>69.171.224.32</div>
<div><br></div><div>;; Query time: 290 msec</div><div>;; SERVER: <server-ip>#53(<server-ip>)</div><div>;; WHEN: Tue Dec  4 10:14:50 2012</div><div>;; MSG SIZE  rcvd: 126</div><div><br></div><div>pdns log output:</div>
<div><br></div><div>Dec  4 04:14:47 server pdns[30109]: Domain: <a href="http://facebook.com">facebook.com</a> Code type: 6</div><div>Dec  4 04:14:47 server pdns[30109]: Domain: com Code type: 6</div><div>Dec  4 04:14:47 server pdns[30109]: Domain:  Code type: 6</div>
<div><br></div><div><br></div><div>database records:</div><div><br></div><div>pdns-3.1:</div><div>+----+----------+------------+---------------+--------------+------+-----------+</div><div>| id | logdate  | utime      | ip            | query                             | type | times_met |</div>
<div>+----+----------+------------+---------------+--------------+------+-----------+</div><div>| 18 | 20121204 | 1354586125 | <source ip>   | <a href="http://google.com">google.com</a>      | SOA  |         5 |</div>
<div>| 19 | 20121204 | 1354586125 | <source ip>   | com                 | SOA  |         8 |</div><div>| 20 | 20121204 | 1354586125 | <source ip>   |                        | SOA  |         8 |</div><div>| 21 | 20121204 | 1354590734 | <source ip>   | <a href="http://facebook.com">facebook.com</a>   | SOA  |         3 |</div>
<div>+----+----------+------------+---------------+--------------+------+-----------+</div><div>4 rows in set (0.04 sec)</div><div><br></div><div><br></div><div>pdns-2.9.22:</div><div><br></div><div>+-------+----------+------------+---------------+------------------+------+-----------+</div>
<div>| id    | logdate  | utime      | ip            | query                                 | type | times_met |</div><div>+-------+----------+------------+---------------+------------------+------+-----------+</div><div>
| 64420 | 20121204 | 1354592035 | <source ip>   | <a href="http://facebook.com">facebook.com</a>     | A    |         1 | </div><div>+-------+----------+------------+---------------+------------------+------+-----------+</div>
<div><br></div><div>pdns-2.9.22 correct detects SOA and A qtypes, but pdns-3.1 only SOA. May be i missing something?</div><div><br></div><div>Best regards,</div><div>Ilya</div>