[Techtalk] Name Service Lookup Fails Under Wordpress
Kai MacTane
kai at mactane.org
Tue Jan 19 18:10:06 UTC 2010
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)):
allow_url_fopen is: 1
DiG returns:
; <<>> DiG 9.4.2 <<>> www.dreamwidth.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55419
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 4
;; QUESTION SECTION:
;www.dreamwidth.org. IN A
;; ANSWER SECTION:
www.dreamwidth.org. 470 IN CNAME dreamwidth.org.
dreamwidth.org. 470 IN A 69.174.244.50
;; AUTHORITY SECTION:
dreamwidth.org. 86270 IN NS ns2.mydyndns.org.
dreamwidth.org. 86270 IN NS ns3.mydyndns.org.
dreamwidth.org. 86270 IN NS ns5.mydyndns.org.
dreamwidth.org. 86270 IN NS ns4.mydyndns.org.
dreamwidth.org. 86270 IN NS ns1.mydyndns.org.
;; ADDITIONAL SECTION:
ns4.mydyndns.org. 43316 IN A 91.198.22.76
ns5.mydyndns.org. 43315 IN A 203.62.195.76
ns3.mydyndns.org. 43315 IN A 208.78.69.76
ns2.mydyndns.org. 43315 IN A 204.13.249.76
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Jan 19 10:05:14 2010
;; MSG SIZE rcvd: 229
Something went wrong getting the challenge string from host
www.dreamhost.org - -32300 : transport error - could not open socket: 0
php_network_getaddresses: getaddrinfo failed: Temporary failure in name
resolution
> The contents of /etc/nsswitch.conf might be interesting too.
I don't think I've altered this from its OS default; here are the entire
contents of the file. Thanks for helping with this.
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# [NOTFOUND=return] Stop searching if not found so far
#
# passwd: files nis
# shadow: files nis
# group: files nis
passwd: compat
group: compat
hosts: files dns
networks: files
services: files
protocols: files
rpc: files
ethers: files
netmasks: files
netgroup: files
bootparams: files
automount: files
aliases: files
--
Kai MacTane
LAMP, AJAX, and Ruby on Rails developer
http://kai.mactane.org
More information about the Techtalk
mailing list