Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'hosts': 0.07; 'subject:skip:s 10': 0.07; 'imply': 0.09; 'downside': 0.16; 'file;': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lookups': 0.16; 'roy': 0.16; 'subject:slow': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code,': 0.22; 'certainly': 0.24; '(or': 0.24; 'changes,': 0.26; 'equivalent': 0.26; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'fixed': 0.29; 'am,': 0.29; 'subject:) ': 0.29; 'message- id:@mail.gmail.com': 0.30; 'sep': 0.31; 'subject:from': 0.34; 'subject: (': 0.35; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; 'entry': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'issue': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'you.': 0.62; 'subject:skip:g 10': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=cCOIRCcsmI8v0ZTFvOUw2IEThFmZAFA/wFxcOveVWnc=; b=0rbnYWJ/UI6skbKgTJ1EovFL6bbzvLGxjOmDs7VFy5VEI23fGZLXi3Hn/LxNW8zDND LqW3UiPy8GIbAfvBWUyHiKOdrFNV9zBUDRxpPYBX5Sh+h+0d5kLvXg99eIrIeVAC0Ds1 JsAyqq+Dt/lzk++lUpd2+/5LMVkTDaxXQqPpiMJduaNIyfX/rIZWxSppiTtzTFgKm32/ NQiUvGJGO8+ySk0yPspi0A27FMGaE3JfXrdiBwK/JuDw1gRB/8IaUCfR655pdVKZb+YD TuqDOoB20+TUYWn7lZTKmf+xPfzlkhMv12VBSU/3DdFcocDkmUWBfBqnkQRji+CeOb4G 9dIg== MIME-Version: 1.0 X-Received: by 10.58.100.234 with SMTP id fb10mr25228250veb.5.1378156365624; Mon, 02 Sep 2013 14:12:45 -0700 (PDT) In-Reply-To: <3f4962dc-b139-4a67-8d0f-f2d59952a45f@googlegroups.com> References: <9cca25d5-186d-4a92-893c-f7985fad7a55@googlegroups.com> <00843d58-db21-4cf0-9430-85362a1dd66f@googlegroups.com> <3f4962dc-b139-4a67-8d0f-f2d59952a45f@googlegroups.com> Date: Tue, 3 Sep 2013 07:12:45 +1000 Subject: Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378156372 news.xs4all.nl 15885 [2001:888:2000:d::a6]:48262 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53528 On Tue, Sep 3, 2013 at 3:52 AM, 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 shoul= d be fixed somewhere else (or perhaps "didn't know", as you seem to imply t= hat 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