On Sat, Jul 23, 2011 at 1:44 PM, Gavin <[email protected]> wrote: > Below is example code to reproduce, and the output of the exception which > ALWAYS takes 30 seconds: > > import dns.resolver > > d = dns.resolver.Resolver() > d.Timeout = 2.0 > a = '' >
Hi Gavin, Regarding the timeout issue, there are two values at play here. The query() method makes repeated queries to the nameserver(s) specified in the Resolver instance until it receives a valid response or times out. The "timeout" instance variable specifies the time to wait for an individual query to a server before giving up and trying again; the "lifetime" instance variable is the maximum time it spends trying. As you mentioned, the servers are responding quickly, but they aren't configured properly, so the response from the resolver(s) is SERVFAIL. To speed up the timeout in query() in this case, use "lifetime" not "timeout": d.lifetime = 2.0 Regards, Casey _______________________________________________ dnspython-users mailing list [email protected] http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users
