bad httplib latency due to IPv6 use

Roy Smith roy at panix.com
Wed Oct 17 20:28:47 EDT 2012


In article <eil2l9-nhm.ln1 at satorlaser.homedns.org>,
 Ulrich Eckhardt <ulrich.eckhardt at dominolaser.com> wrote:

> Some updates on the issue:
> 
> The etc/hosts file contains the following lines:
> 
> # localhost name resolution is handled within DNS itself.
> #       127.0.0.1       localhost
> #       ::1             localhost
> 
> As I understand it, those effectively mean that localhost is not 
> resolved via this hosts file but "within DNS itself", whatever that 
> exactly means.

The path from hostname to IP address is a long and tangled one.  It 
starts with a call to getaddrinfo().  From there, the details depend on 
a wide variety of decisions made by whatever idiots designed, installed, 
and configured your operating system.

One likely path is to check in /etc/nsswitch.conf to see what data 
sources the resolver should consult.  On the box I'm using at the 
moment, it says:

hosts:          files dns

which is pretty typical.  That means, first look in [some set of static 
files, which usually, but not always, means /etc/hosts], and if you 
don't find it there, ask DNS.  Other possibilities include NIS, NISPLUS, 
and maybe some other perverse things.

And, finally, you get to DNS, so now you have to look in (probably) 
/etc/resolv.conf.  I see on my linux box, even that has grown more 
tendrils; there's a whole /etc/resolvconf *directory* full of more 
config files which describe additional ways somebody could have 
misconfigured this mess.

Personally, if I were you (and assuming you don't have some corporate IT 
nazis to deal with), I would just put localhost in /etc/hosts and be 
done with it.



More information about the Python-list mailing list