Thank you, Casey!

By the way, where would I be able to find this in the documentation? Being a
mostly self-taught mostly-novice programmer I probably don't grok the
documentation as well as I could.

Is there also a way to specify a retry limit rather than a time limit? The
time limit works fine for what I need, but I am also curious about this now.

And one last question - do you think using dnspython is suitable when I only
need a single A record? As I mentioned before socket.gethostbyname() has
been working fine as my workaround. Any reason to use one over the other?

Thanks again!

On Sat, Jul 23, 2011 at 10:23 PM, Casey Deccio <[email protected]> wrote:

> 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

Reply via email to