Home > Archive > PERL Modules > May 2004 > Bad hostname error from LWP::UserAgent??
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Bad hostname error from LWP::UserAgent??
|
|
| Ed Eaton 2004-05-20, 12:31 pm |
| I'm using LWP to POST some info from one Perl script to another, both on the
same
server/domain. It just happened to be the easiest implementation at the
time...
Anyway, the problem is that every now and then I get the following error
from LWP:
500 Can't connect to www.mydomain.com:80 (Bad hostname 'www.mydomain.com')
This script runs a few 1000 times per day, and it just started doing this
yesterday.
It usually works fine but I've received this error message maybe 20-25 times
out of the
past 2000 attempts. Anyone have any idea what's going on?
Thanks,
Ed
| |
| Ed Eaton 2004-05-20, 1:30 pm |
| Forgot to mention I'm running LWP 5.53.
Thanks,
Ed
| |
| Sherm Pendley 2004-05-20, 1:30 pm |
| Ed Eaton wrote:
> I'm using LWP to POST some info from one Perl script to another, both on
> the same server/domain. It just happened to be the easiest implementation
....
> It usually works fine but I've received this error message maybe 20-25
> times out of the past 2000 attempts. Anyone have any idea what's going on?
"Bad hostname" often means DNS problems.
Try adding the host name to /etc/hosts to avoid having to use an external
DNS lookup, or better still avoid the lookup entirely and connect through
the loopback address (127.0.0.1).
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
| |
| Ed Eaton 2004-05-20, 1:30 pm |
| > Try adding the host name to /etc/hosts to avoid having to use an external
> DNS lookup, or better still avoid the lookup entirely and connect through
> the loopback address (127.0.0.1).
Hi Sherm,
Thanks for the response. I'm new to this "stuff", so just to clarify, if I
am currently POSTing to:
http://www.mysite.com/cgi-bin/script.cgi
Then I can change this to:
http://127.0.0.1/cgi-bin/script.cgi
Is that what you mean?
Thanks,
Ed
| |
| Ed Eaton 2004-05-20, 1:30 pm |
| > Try adding the host name to /etc/hosts to avoid having to use an external
> DNS lookup, or better still avoid the lookup entirely and connect through
> the loopback address (127.0.0.1).
FYI I forgot to mention that the host name is already in /etc/hosts. It's
the main/only domain being used on the server, and the same domain that both
scripts are running under. Actually it's listed in /etc/hosts as
mydomain.com ... should I also list it as www.mydomain.com with the same IP?
Ed
| |
| Juha Laiho 2004-05-21, 2:31 pm |
| "Ed Eaton" <saveperclick@hotmail.com> said:
>
>FYI I forgot to mention that the host name is already in /etc/hosts. It's
>the main/only domain being used on the server, and the same domain that both
>scripts are running under. Actually it's listed in /etc/hosts as
>mydomain.com ... should I also list it as www.mydomain.com with the same IP?
Well, if your hosts file has an IP for mydomain.com, and you're
connecting to www.mydomain.com, then your hosts file isn't used for
the connection.
Note that hosts file should only have one line per numeric IP address,
so the www.mydomain.com apparently should go there as an alias for the
mydomain.com entry. You might also wish to check your resolver configuration
(often line starting "hosts:" in /etc/nsswitch.conf) to make sure you
have hosts file as the primary host name resolver.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
|
|
|
|
|