[Twisted-Python] Custom DNS server

Jp Calderone exarkun at intarweb.us
Wed Jul 23 18:48:58 EDT 2003


On Wed, Jul 23, 2003 at 10:50:00PM +0200, Rudy Schockaert wrote:
> Jp Calderone wrote:
> 
> > This should be pretty easy.  I think the way to go about it would be to
> >subclass t.names.client.Resolver and override lookupMailExchange(),
> >returning the central relay address instead for the affected domains, and
> >deferring (english meaning) to the parent implementation of the method for
> >everyone else.
> > 
> >
> Hi Jp,
> 
> [snip]
> 
> I have two caches: one preloaded with my entries and a second one that 
> is empty at the start.
> When a request arrives for a record that is in my preloaded cache it is 
> returned, but also added to the second cache (actually to the last cache 
> passed to the DNSServerFactory)..
> callLater in cacheResult will remove it later from the second cache but 
> not from the first cache.
> All other entries will follow the normal way, be it with one 
> cache-lookup extra.
> 
> Is there somewhere an error in my reasoning? Are there other reasons why 
> this is not a good approach?
> 

  This looks like a pretty good solution, actually.  I wish I'd thought of
it :)

  The only possible problem I can imagine is that the extra latency created
by the extra cache miss before most lookups may confuse some clients -- but
on a modern piece of hardware (something I don't have myself, hence my
concern about such things :), I doubt this would actually be a problem.

  Jp

-- 
"One World, one Web, one Program." - Microsoft(R) promotional ad
"Ein Volk, ein Reich, ein Fuhrer." - Adolf Hitler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030723/7072db6b/attachment.pgp 


More information about the Twisted-Python mailing list