You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Aaron Turner <sy...@gmail.com> on 2009/04/12 00:31:27 UTC
[users@httpd] Apache (php5/fcgi) can't resolve hostnames
At first I thought this was a problem with my python/fastcgi config,
but now I've noticed that php5 apps like Wordpress can't resolve hosts
either. Resolving hosts works just fine on the command line via the
"host" command though so it's not like DNS is broken. Hence it seems
that the common link is apache. Anyone have any suggestions on how to
debug this?
OS X 10.5.6
Apache 2.2.11 (via MacPorts)
Thanks,
Aaron
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Brian Mearns <me...@gmail.com>.
On Tue, Apr 14, 2009 at 11:32 AM, Aaron Turner <sy...@gmail.com> wrote:
> Nobody has any ideas???
>
> On Sat, Apr 11, 2009 at 3:31 PM, Aaron Turner <sy...@gmail.com> wrote:
>> At first I thought this was a problem with my python/fastcgi config,
>> but now I've noticed that php5 apps like Wordpress can't resolve hosts
>> either. Resolving hosts works just fine on the command line via the
>> "host" command though so it's not like DNS is broken. Hence it seems
>> that the common link is apache. Anyone have any suggestions on how to
>> debug this?
>>
>> OS X 10.5.6
>> Apache 2.2.11 (via MacPorts)
[clip]
Aaron,
I understand your frustration at having an unresolved problem, but
clearly if somebody had an idea, they would have posted it.
-Brian
--
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
> On Wed, Apr 15, 2009 at 10:33 PM, Krist van Besien
> <kr...@gmail.com> wrote:
> > On Thu, Apr 16, 2009 at 12:30 AM, Aaron Turner <sy...@gmail.com> wrote:
> >> Looks like I figured it out.
> >>
> >> OSX's internal name resolution API calls (gethostbyname?) apparently
> >> doesn't honor /etc/resolv.conf, but the 'host' command does.
> >
> > This is also why "getent hosts" is a better tool to debug DNS issues
> > than the "host" command.
On 16.04.09 08:39, Aaron Turner wrote:
> Alas, getent doesn't exist on OSX.
do you have /ertc/nsswitch.conf?
However, this is a problem of OSX, not apache
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
BSE = Mad Cow Desease ... BSA = Mad Software Producents Desease
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Aaron Turner <sy...@gmail.com>.
On Wed, Apr 15, 2009 at 10:33 PM, Krist van Besien
<kr...@gmail.com> wrote:
> On Thu, Apr 16, 2009 at 12:30 AM, Aaron Turner <sy...@gmail.com> wrote:
>> Looks like I figured it out.
>>
>> OSX's internal name resolution API calls (gethostbyname?) apparently
>> doesn't honor /etc/resolv.conf, but the 'host' command does.
>
> This is also why "getent hosts" is a better tool to debug DNS issues
> than the "host" command.
Alas, getent doesn't exist on OSX.
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Apr 16, 2009 at 12:30 AM, Aaron Turner <sy...@gmail.com> wrote:
> Looks like I figured it out.
>
> OSX's internal name resolution API calls (gethostbyname?) apparently
> doesn't honor /etc/resolv.conf, but the 'host' command does.
This is also why "getent hosts" is a better tool to debug DNS issues
than the "host" command.
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Aaron Turner <sy...@gmail.com>.
Looks like I figured it out.
OSX's internal name resolution API calls (gethostbyname?) apparently
doesn't honor /etc/resolv.conf, but the 'host' command does.
Also, OSX doesn't like it if you've only configured 127.0.0.1 as your
only nameserver, even if you have a perfectly good local named running
on loopback. No idea why, using dig against localhost worked just
fine.
Long story short, going into System Preferences -> Networking -> Advanced -> DNS
and adding additional dns servers after 127.0.0.1 seems to have solved
the problem.
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Aaron Turner <sy...@gmail.com>.
On Wed, Apr 15, 2009 at 11:30 AM, Paul Puschmann
<pp...@googlemail.com> wrote:
> Do you have more than one ethernet-interface?
> Perhaps your Apache is bound to an interface that has no connections
> to the outside?
Excellent idea, but I have only one interface and apache is bound to
that. Apache is accessible via the outside world.
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Paul Puschmann <pp...@googlemail.com>.
On Wed, Apr 15, 2009 at 10:31:52AM -0700, Aaron Turner wrote:
> On Tue, Apr 14, 2009 at 11:34 PM, Krist van Besien
> <kr...@gmail.com> wrote:
> > On Tue, Apr 14, 2009 at 5:32 PM, Aaron Turner <sy...@gmail.com> wrote:
> >> Nobody has any ideas???
> >>
> >> On Sat, Apr 11, 2009 at 3:31 PM, Aaron Turner <sy...@gmail.com> wrote:
> >>> At first I thought this was a problem with my python/fastcgi config,
> >>> but now I've noticed that php5 apps like Wordpress can't resolve hosts
> >>> either. Resolving hosts works just fine on the command line via the
> >>> "host" command though so it's not like DNS is broken. Hence it seems
> >>> that the common link is apache. Anyone have any suggestions on how to
> >>> debug this?
> >>>
> >>> OS X 10.5.6
> >>> Apache 2.2.11 (via MacPorts)
> >
> > We have lots of ideas, but you should provide us with more information
> > about your problem before we can help you.
> >
> > You say that "php5.apps can't resolve hosts". What do you mean by
> > that? What is it that you are doing, what are you expecting, and what
> > are you getting in stead of what you expect?
>
> I mean that PHP/Python code running under Apache is attempting to
> connect to other hosts and in doing so is requiring a DNS hostname
> lookup to resolve the IP address. This lookup is failing, which
> prevents the connection from succeeding.
>
> For example, Wordpress w/ the Aksimet plugin tries to resolve
> <mykey>.api.akismet.com. This works just fine from the command line,
> but returns an error "Unable to resolve host". Trac (running under
> fastcgi/python) is having issues resolving hosts for re-captcha.
> Again, this works just fine from a shell.
>
> It's not just anti-spam things either. Wordpress couldn't resolve
> twitter.com in order to pull an RSS feed. However, once I added an
> entry for twitter.com to my /etc/hosts, the problem went away. This
> was my smoking gun.
>
> Another PHP application (Gallery) is also having dns resolving issues
> for Akismet (same service, different codebase).
>
> For a long time I thought this was just a PHP issue and then I noticed
> Trac (which isn't PHP) was having the same issue. The only
> commonality is that both run under Apache. Other services (postfix
> for example) on the same box have no issue resolving hosts.
>
> Of course, maybe they're two totally unrelated issues, but it seems
> like too big of a coincidence to ignore.
Do you have more than one ethernet-interface?
Perhaps your Apache is bound to an interface that has no connections
to the outside?
Paul
--
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Aaron Turner <sy...@gmail.com>.
On Tue, Apr 14, 2009 at 11:34 PM, Krist van Besien
<kr...@gmail.com> wrote:
> On Tue, Apr 14, 2009 at 5:32 PM, Aaron Turner <sy...@gmail.com> wrote:
>> Nobody has any ideas???
>>
>> On Sat, Apr 11, 2009 at 3:31 PM, Aaron Turner <sy...@gmail.com> wrote:
>>> At first I thought this was a problem with my python/fastcgi config,
>>> but now I've noticed that php5 apps like Wordpress can't resolve hosts
>>> either. Resolving hosts works just fine on the command line via the
>>> "host" command though so it's not like DNS is broken. Hence it seems
>>> that the common link is apache. Anyone have any suggestions on how to
>>> debug this?
>>>
>>> OS X 10.5.6
>>> Apache 2.2.11 (via MacPorts)
>
> We have lots of ideas, but you should provide us with more information
> about your problem before we can help you.
>
> You say that "php5.apps can't resolve hosts". What do you mean by
> that? What is it that you are doing, what are you expecting, and what
> are you getting in stead of what you expect?
I mean that PHP/Python code running under Apache is attempting to
connect to other hosts and in doing so is requiring a DNS hostname
lookup to resolve the IP address. This lookup is failing, which
prevents the connection from succeeding.
For example, Wordpress w/ the Aksimet plugin tries to resolve
<mykey>.api.akismet.com. This works just fine from the command line,
but returns an error "Unable to resolve host". Trac (running under
fastcgi/python) is having issues resolving hosts for re-captcha.
Again, this works just fine from a shell.
It's not just anti-spam things either. Wordpress couldn't resolve
twitter.com in order to pull an RSS feed. However, once I added an
entry for twitter.com to my /etc/hosts, the problem went away. This
was my smoking gun.
Another PHP application (Gallery) is also having dns resolving issues
for Akismet (same service, different codebase).
For a long time I thought this was just a PHP issue and then I noticed
Trac (which isn't PHP) was having the same issue. The only
commonality is that both run under Apache. Other services (postfix
for example) on the same box have no issue resolving hosts.
Of course, maybe they're two totally unrelated issues, but it seems
like too big of a coincidence to ignore.
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Krist van Besien <kr...@gmail.com>.
On Tue, Apr 14, 2009 at 5:32 PM, Aaron Turner <sy...@gmail.com> wrote:
> Nobody has any ideas???
>
> On Sat, Apr 11, 2009 at 3:31 PM, Aaron Turner <sy...@gmail.com> wrote:
>> At first I thought this was a problem with my python/fastcgi config,
>> but now I've noticed that php5 apps like Wordpress can't resolve hosts
>> either. Resolving hosts works just fine on the command line via the
>> "host" command though so it's not like DNS is broken. Hence it seems
>> that the common link is apache. Anyone have any suggestions on how to
>> debug this?
>>
>> OS X 10.5.6
>> Apache 2.2.11 (via MacPorts)
We have lots of ideas, but you should provide us with more information
about your problem before we can help you.
You say that "php5.apps can't resolve hosts". What do you mean by
that? What is it that you are doing, what are you expecting, and what
are you getting in stead of what you expect?
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Re: Apache (php5/fcgi) can't resolve hostnames
Posted by Aaron Turner <sy...@gmail.com>.
Nobody has any ideas???
On Sat, Apr 11, 2009 at 3:31 PM, Aaron Turner <sy...@gmail.com> wrote:
> At first I thought this was a problem with my python/fastcgi config,
> but now I've noticed that php5 apps like Wordpress can't resolve hosts
> either. Resolving hosts works just fine on the command line via the
> "host" command though so it's not like DNS is broken. Hence it seems
> that the common link is apache. Anyone have any suggestions on how to
> debug this?
>
> OS X 10.5.6
> Apache 2.2.11 (via MacPorts)
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org