I'm on centos, and I need to check that an AD server is running (is in another host). Which is the simplest way to check ldap (AD) is running? I have an application where I need to synchronize some users account with AD, but suddenly I'm getting 0 users found. I don't know much about AD and LDAP, I just tested with:

[root@mysystem]# ldapsearch -x
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

Is that enough to check that LDAP is down? Or can it be another reason?


1 Answer 1


Can't contact LDAP server (-1) doesn't explicitly mean that your AD isn't "running".
There are few things that could cause that error.

  • Server being shutdown
  • Deamon stopped
  • and many more...

You might also have some misconfiguration, or something else blocking you to contact your AD.

However, if you can ldapsearch with some anonymous request (with -x) just before, I suppose that's an acceptable way to check.

If I refer myself to this previous post How to test a LDAP connection from a client, the test you're currently using should be fine. (considering it was working before, and it's a connectivity issue, and not a misconfiguration)

Make yourself sure that anonymous authentication are enable, and you can actually query the AD with it.

enter image description here

  • I did [root@mysystem]# telnet 389 Trying Connected to Escape character is '^]'. so that means that the server is up but, then?
    – pmiranda
    Commented Feb 21, 2018 at 15:33
  • Can you maybe check the config files of the server/user trying to access your AD ? Check also if they can actually query with anonymous auth.
    – Tolsadus
    Commented Feb 21, 2018 at 15:34
  • Hmm, I'll have to ask to the sysadmin of the LDAP server I think :/ as I said I was able to connect to LDAP just a few days ago and suddenly it stopped
    – pmiranda
    Commented Feb 21, 2018 at 17:51
  • Ok, all was fine, connection was ok, LDAP is up. I had some issues in my app config. All good now.
    – pmiranda
    Commented Feb 21, 2018 at 19:29
  • 1
    Awesome ! Have a good day :D
    – Tolsadus
    Commented Feb 21, 2018 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .