[Techtalk] Name Service Lookup Fails Under Wordpress

Wim De Smet kromagg at gmail.com
Fri Jan 22 11:02:19 UTC 2010


Hi,

On Tue, Jan 19, 2010 at 7:10 PM, Kai MacTane <kai at mactane.org> wrote:
> Wim De Smet wrote:
>>
>> It is weird that it would work in the admin interface, if that is
>> running in the exact same instance of your server. Might indeed be a
>> PHP problem. Can you try doing a lookup from the cmdline (with dig)
>> when it fails in PHP to see if everything resolves correctly?
>
> I've hacked the class-IXR.php file to include the following inside the
> query() method, just before the fsockopen() call:
>
> print "allow_url_fopen is: " . ini_get('allow_url_fopen') . "<br>\n<br>\n";
> print "DiG returns:<br>\n<pre>";
> passthru('dig www.dreamwidth.org');
> print "</pre>\n";
>
> This prints out a very normal-looking DiG response in the error page, right
> before the error message I've described before. Just in case it matters,
> here's the page, including the DiG output (though I suspect you'd get
> identical results from 'dig www.dreamwidth.org' on your own machine(s)):

Just going back through the previous mails, I was wondering if you've
tried doing your own fsockopen() call instead of using gethostbyname()
to test if it works. fsockopen() likely uses a different execution
path to get to DNS. Dig would work at this point because whatever is
keeping the PHP process from finding the correct nameserver has
already been resolved.

I've come across some references to the problem being no valid DNS
servers at the time of apache startup, which sounds plausible.

regards,
Wim


More information about the Techtalk mailing list