Fixing “ldap_bind: Can’t contact LDAP server” error
Wednesday 30th November, 2005 | 7:37 pmIf, whilst trying to configure and test OpenLDAP it fails upon attempting to perform an initial query of the LDAP server along the lines of:
ldap_connect_to_host: getaddrinfo failed: Name or service not known
ldap_perror
ldap_bind: Can't contact LDAP server
the most common issue is incorrect naming with /etc/hosts . Of course, this is assuming you know you have your configuration setup right! Additional debug information during the query process can be obtained by adding “-d 255″ to your command.
Within your hosts file, it is common to have something like:
192.168.0.200 fatcontroller.homelinux fatcontroller
which would cause OpenLDAP to fail with the above error message. Instead, the full FQDN must be set, as per the LDAP configuration itself, such as:
192.168.0.200 fatcontroller.homelinux.net fatcontroller
Now, when trying to perform an initial query, it will be successful.
Posting your comment...
Iain Foulds, 26 years old. Originally from England, now living in St Louis after 4 years in Alaska. I currently work as a freelance IT consultant, focusing on virtualization solutions. Very passionate about photography.
2 Responses to “Fixing “ldap_bind: Can’t contact LDAP server” error”
IndiaMozilla 1.6a Linux
July 29th, 2009 at 5:32 pm
thanks for your post,it very usable for my server
IndiaMozilla Firefox 3.0 Windows XP
August 2nd, 2010 at 2:39 am
ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)
i am getting this error!
any suggestion