. Advertisement .
..3..
. Advertisement .
..4..
I am working with programs and getting the error message:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server(-1)
Here is the detail of the code that I ran:
ldapsearch -x -H "ldap://ldap.techvictus.local" -P 3 -LLL -b "dc=techvictus,dc=local"
I need an explanation for the problems I’ve encountered. How to fix ldap_sasl_bind simple can’t contact ldap server (-1)?
The cause:
After researching your program for hours, I realize that your ldap.conf was previously configured with your IP address. However, the hostname
ldap.techvictus.local
actually is not an address, it is just a fake domain name. Therefore, you get the error: ”ldap_sasl_bind simple can’t contact ldap server (-1)”.Solution:
I suggest that you should use the IP address of your system instead of using 127.0.1.1, or you can use FQDN after the IP address as the following:
To remove the fake domain name, you need to alter
ldap.conf
to getURI ldap://${IP_ADDRESS}
Another way is trying:
ldap://localhost
If you follow the ways I suggest above, I sure that your error will go away.
The hostname
ldap.techvictus.local
I think is not addressable (i.e. A hostname that can be resolved using an IP address.Use
ldap://localhost