[Sussex] Ruby DNS resolver

Nic James Ferrier nferrier at tapsellferrier.co.uk
Wed Sep 6 12:08:10 UTC 2006


Ronan Chilvers <ronan at thelittledot.com> writes:

> Been kicking around with ruby and DNS resolving, as you do!! Finding the
> DNS resolution is VERY slow. Putting together a little class to check IPs 
> in DNSBL lists. Looking up 1 ip in 4 DNSBLs takes over a minute which is 
> way too slow. The eventual idea is putting together a little policy
> script for postfix which scores a set of mail attributes based on
> various stuff including DNSBL results.
>
> Anyone any thoughts on speeding this up? I've tried both resolv and
> resolv-replace libraries and there's no discernable difference in
> speed.

Any idea why it's so slow?

Are normal DNS lookups ok?

Are DNS lookups in python (or perl) ok?

Try:

  python -c 'import socket ; print socket.gethostbyname("www.tfnet.co.uk")'


I use a local, caching name server to speed up regular calls... but
that wouldn't solve an upstream problem.

-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs




More information about the Sussex mailing list