develooper Front page | perl.libwww | Postings from July 2015

Re: DNS lookup failures: (Bad hostname)

Thread Previous
Bill Moseley
July 28, 2015 06:22
Re: DNS lookup failures: (Bad hostname)
Message ID:
On Fri, Jan 9, 2015 at 7:27 AM, Bill Moseley <> wrote:

> On our production machines running LWP 6.04 and LWP::Protocol::https 6.03
> I see a few times a day messages like:
> 500 Can't connect to (Bad hostname)
> Yet, when I try fetching using lwp-request on the same machine the lookup
> works fine and I can fetch the content.
> I suspect an issue with our own DNS, but I'm only aware of these lookup
> failures reported by LWP (we have lots of other non-Perl code that is doing
> lookups all day long).
> Anyway, I just wanted to check here to see if anyone else has also seen
> hostname lookup failures for valid hostnames that might indicate a problem
> in the Perl libraries.
> I'll look at adding more debugging -- like running dig or hostname on LWP
> failures of this type and see if those also fail at the same time.    Any
> other ideas for debugging?

Would a timeout indicate that "Bad hostname" error?   Doesn't seem likely.

I continue to see these for the above and other hosts.  For example a few
from today for Paypal:

Can't connect to (Bad hostname)

LWP::Protocol::https::Socket: Bad hostname '' at
/usr/share/perl5/LWP/Protocol/ line 51.

Whenever I ssh into the machine and do a lookup it works fine.   So, any
ideas what might be different?

$ time host is an alias for is an alias for is an alias for is an alias for is an alias for has address

real 0m0.003s
user 0m0.000s
sys 0m0.002s

Bill Moseley

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About