gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

Chris Angelico rosuav at gmail.com
Mon Sep 2 17:12:45 EDT 2013


On Tue, Sep 3, 2013 at 3:52 AM,  <anntzer.lee at gmail.com> wrote:
> To be honest, knowing nothing about DNS configuration, I don't even know if adding the entry to /etc/hosts is the "proper" fix or if the issue should be fixed somewhere else (or perhaps "didn't know", as you seem to imply that that is not the correct way).

Since you can't change the code, it's almost certainly the best
solution available to you. It's more-or-less equivalent to speeding up
your DNS lookups massively. The main downside is that if something
changes, you need to change it in DNS and in your hosts file; as Roy
says, it's a pragmatic solution rather than a perfect one.

ChrisA



More information about the Python-list mailing list