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"><<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>></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>
>Hi Guys,<br>
><br>
>Im playing with a dns-cache script, that overrides DNS requests for<br>
>certain<br>
>IP addresses.<br>
><br>
>I would like to add functionality, so unresolved requests are sent to a<br>
>spicific IP. How do I go about doing that?<br>
><br>
>Is there a negative answer in the (udp) DNS protocol or am I forced to<br>
>use a<br>
>timeout.<br>
<br>
</div>You'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'm not sure how<br>
you'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>