Hi Jean-Paul,<br><br>Thanx for your nice reply. My problem seems to be that I dont get any calls to writemessage when the domain is a bogus one?<br><br>/tax<br><br><br><br><div class="gmail_quote">2009/10/22  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 20 Oct, 07:50 pm, <a href="mailto:jesper@taxboel.dk">jesper@taxboel.dk</a> wrote:<br>

&gt;Hi Guys,<br>
&gt;<br>
&gt;Im playing with a dns-cache script, that overrides DNS requests for<br>
&gt;certain<br>
&gt;IP addresses.<br>
&gt;<br>
&gt;I would like to add functionality, so unresolved requests are sent to a<br>
&gt;spicific IP. How do I go about doing that?<br>
&gt;<br>
&gt;Is there a negative answer in the (udp) DNS protocol or am I forced to<br>
&gt;use a<br>
&gt;timeout.<br>
<br>
</div>You&#39;ve overridden writeMessage to inspect messages for answers and<br>
rewrite them if necessary.  You can recognize error responses by looking<br>
at the rCode attribute of the message object itself.  This will take on<br>
a value like dns.OK, dns.EFORMAT, dns.ESERVER, dns.ENAME, dns.ENOTIMP,<br>
or dns.EREFUSED.  You can handle these errors by making a request of<br>
another domain, although since writeMessage is a very low-level API in<br>
the process and not really intended to be overridden, I&#39;m not sure how<br>
you&#39;ll insert the responses you get from these new requests into the<br>
original request/response process.<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br>