[Python-Dev] _socket efficiencies ideas

Sean Reifschneider jafo@tummy.com
Wed, 9 Apr 2003 08:40:37 -0600


On Thu, Apr 10, 2003 at 12:24:45AM +1000, Anthony Baxter wrote:
>Ick ick. This is putting a bunch of code for a stub resolver into python.
>This stuff is hard to get right - I implemented this on top of pydns, and
>it was a lot of work to get (what I think is) correct, for not very much
>gain.

Well, ideally you'd cache the data for as long as the SOA says to cache
it.  However, it sounds like in the situation that started this thread,
even caching that data for some small but configurable number of seconds
might help out.

>The idea of either suppressing DNS lookups for all-numeric addresses, or
>some sort of extended API for suppressing DNS lookups might be better,
>but really, isn't this the job of the stub resolver?

Definitely, on both counts...  I like the idea of the "<numeric>127.0.0.1"
or otherwise somehow specifying that the address shouldn't be resolved.
I wouldn't think that it'd be good to do lookups of purely IP addresses,
but there is probably some obscure part of some spec that says it should
happen.

Contrary to popular belief, just because I know that IP addresses get
padded with 0s, I'm not a networking lawyer.  ;-)  I learned that trick
because it can help make dealing with IPV6 addresses much easier, but
I've found it most useful with 127.1.

Sean
-- 
 This message is REALLY offensive, so I ROT-13d it TWICE.
                 -- Sean Reifschneider being silly on #python, 2000
Sean Reifschneider, Inimitably Superfluous <jafo@tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin