On Saturday, August 31, 2013 10:06:43 PM UTC-7, Michael Torrie wrote:
> On 08/31/2013 10:51 PM, anntzer....@gmail.com wrote:
> 
> > It is the call to gethostbyname_ex that is very slow.  The call to
> > gethostname is quick (and returns the same string as
> > /usr/bin/hostname).
> 
> What gethostbyname_ex and /usr/bin/hostname do are very different
> things.  gethostbyname_ex does a DNS lookup against a server.
> /usr/bin/hostname just checks a local computer setting.  I don't see why
> you are comparing the two.  /usr/bin/hostname is not going to help you
> find a list of IP addresses that point to a machine.

I was just replying to the previous comment "name = socket.gethostname() see 
how long that takes and what it returns.  Then, assuming it returns a string 
containing your hostname (massive handwave about what that actually means)", 
saying that gethostname resolves my own hostname instantaneously.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to