#30107 [Opn->Bgs]: ldap_bind does a dns lookup for "localhost" (mod_php not CLI)
| From: | sniper@php.net | Date: | Thu, 16 Sep 2004 08:43:03 +0000 |
| Subject: | #30107 [Opn->Bgs]: ldap_bind does a dns lookup for "localhost" (mod_php not CLI) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66272@lists.php.net to get a copy of this message | ||
ID: 30107
Updated by: sniper@php.net
Reported By: php at gunnarwrobel dot de
-Status: Open
+Status: Bogus
Bug Type: LDAP related
Operating System: Gentoo 2004.2
PHP Version: 4.3.8
New Comment:
It's either a bug in openldap (unlikely) or misconfigured system of
yours. Check your /etc/hosts and /etc/resolv.conf files. See also:
http://www.netsys.com/openldap-software/2002/08/msg00020.html
This is absolutely not a PHP bug whatsoever..
Previous Comments:
------------------------------------------------------------------------
[2004-09-16 10:27:11] php at gunnarwrobel dot de
Description:
------------
After connecting to OpenLDAP on "localhost" subsequent binding fails.
This only happens in mod_php, not with CLI.
Apparently the ldap_bind function of mod_php is unable to resolve
"localhost".
This might be related to bug #29587
Regards
Gunnar
Reproduce code:
---------------
<?
$ds=ldap_connect("localhost", 389);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
if(!ldap_bind($ds,"uid=myuid,dc=mydom,dc=de","mypass"))
{
print "<br />Error<br />";
print(ldap_error($ds));
}
?>
Expected result:
----------------
No error.
Actual result:
--------------
Error
Can't contact LDAP server.
TCPdump reports a request to the name server:
10:20:35.050539 IP myserver.mydom.info.41604 > dns2.arcor-ip.de.domain:
60613+ AAAA? localhost. (27)
10:20:35.061182 IP dns2.arcor-ip.de.domain > myserver.mydom.info.41604:
60613 NXDomain 0/1/0 (102)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30107&edit=1