I'm
trying to write a program that will call my own function whenever a
query to a nameserver times out. I have figured out how to run the DNS
server. And I also know how to use filterAnswers(). But how do I catch
the &quot;Failure: twisted.names.error.<div id=":jt" class="ArwC7c ckChnd">DNSQueryTimeoutError:&quot; messages by adding code to the resolver I&#39;ve constructed?<br>
I&#39;ve got something like this:<br><br>class myResolver(client.Resolver):<br>&nbsp;&nbsp;&nbsp; def filterAnswers(self, message):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print &quot;answer:&quot;,message <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [snipped code]<br><br>resolver = myResolver(servers=[(&#39;10.0.1.1&#39;, 53)])<br>

f = server.DNSServerFactory(clients=[resolver])<br>reactor.listenTCP(4053, f)<br>reactor.run()<br><br>But
I don&#39;t see where to add an addErrback call. The important thing here
is that I&#39;m not getting the&nbsp; domains to look up on the command line or
from the user. They are coming in over a socket from, say, dig. So I&#39;m
trying to avoid parsing those queries myself since the full DNS query
protocol is hefty; that is, I want twisted to do the work of the
parsing the input. Thanks for your help.<br>
<br>-Broder<br></div>