[Twisted-Python] Handeling unresolved DNS queries?

Jesper Taxbøl jesper at taxboel.dk
Thu Oct 22 14:55:05 MDT 2009


I'm still new to the whole twisted way of doing things, but it sounds very
sensible. :)

Could you suggest a class to start studying from ?

/tax

2009/10/22 <exarkun at twistedmatrix.com>

> On 07:00 pm, jesper at taxboel.dk wrote:
> >Hi Jean-Paul,
> >
> >I guess my focus is right when it comes to redirecting clients.
> >
> >Im hooking into
> >
> >DNSDatagramProtocol.writeMessage(self, message, address):
> >
> >And I guess thats OK?
>
> Depends what "OK" is supposed to mean.
> >
> >But when it comes to bogus domains, I guess i could use:
> >
> >DNSServerFactory.gotResolverError(self, failure, protocol, message,
> >address):
>
> I don't know why you should have to do that.
> >My problem is now how I construct a redirect package and channel it
> >back to
> >the client.
> >
> >Do you think that is a sensible approach? -and do you hava a pointer on
> >how
> >to find the associated client.
>
> It would probably be a lot easier and more robust to implement a
> completely new custom resolver that *wraps* an existing resolver, rather
> than trying to extend an existing resolver via a subclass.  This removes
> many irrelevant implementation details from consideration (such as
> writeMessage and gotResolverError) and gives you an obvious place to put
> your redirect logic - in an errback on the Deferred returned by one of
> the wrapped resolver's lookup/query methods.
>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20091022/72217d8f/attachment.html>


More information about the Twisted-Python mailing list