Is there a way to ping and ldap server? I have seen ldapsearch and ldapwhoami but would appreciate something a bit more like ping. Essentially we have a bip address in front of a selection of LDAP servers and are looking to confirm which one we are connecting to.

  • Please take some care and edit your question to make it more clear what you're asking. It may be helpful to explain why you would care what LDAP server you're connecting to. – gWaldo Feb 24 '12 at 1:04
  • 1
    @gWaldo, I suspect he is just looking for a basic tool that makes a null connection to the server, and reports the latency for opening the connection, and possibly return basic details that you can get from a null connection. – Zoredache Feb 24 '12 at 1:42
  • Many thanks, can you advise how I'd test a secure LDAPS server also? – naffcat Feb 24 '12 at 7:46

Ping is a tool aimed for testing (echo) replies from network hosts using the ICMP protocol. LDAP is a protocol that by default lives on TCP port 389, and does not directly communicate with ICMP.

If you're just looking for a tool to give you a quick "yeah, port is open and available", then you can just do a telnet query for port 389 (LDAP) or port 636 (LDAP SSL) with telnet.

telnet hostip 389

You should see something like this:

root@LINXWII:/home/l0c0b0x# telnet ldapsrvip 389
Connected to mainldapsrv.example.com.
Escape character is '^]'.

Lots of people rather use nmap, so you can also do that:

nmap hostip 389

There is also a Microsoft tool called PortQry that will give you a lot of info about a port(s):

PortQry.exe -n hostip -p tcp -e 389

just replace 389 with 636 for LDAP SSL

  • Also, LDAP over SSL is port 636. – gWaldo Feb 24 '12 at 1:42
  • 3
    While PING is most commonly used to mean for a tool that does an ICMP echo/reply, some protocols to have built-in ping facility (eg IRC). I suspect he is looking for some tool that does some kind of basic low-level un-authenticated LDAP status check. – Zoredache Feb 24 '12 at 1:44
  • Many thanks, can you advise how I'd test a secure LDAPS server also? – naffcat Feb 24 '12 at 7:47
  • The idea is testing the port where the service lives. LDAP lives in TCP port 389, LDAP SSL lives in port 636. Find out the important ports and go from there. – l0c0b0x Feb 24 '12 at 16:41

What you are asking is not clear.

You can ping ldap servers.

If you're on a Windows client, check your environment variable LOGONSERVER (via the set command) to determine the DC you're connected to.

  • I'm using Linux - and want to confirm which LDAP server is resolving against ldpserver.bip.domain.com for example – naffcat Feb 24 '12 at 7:48
  • 2
    But why do you care which one you're connected to? – gWaldo Feb 24 '12 at 11:41
  • This is wrong- You can't ping ldap. – Yarin Mar 7 '12 at 15:33
  • But you can ping an ldap server. Just exactly like I said... – gWaldo Mar 7 '12 at 15:51
  • LDAP Ping is it's own thing. Is this question about ICMP ping or is it about LDAP Ping? ldapwiki.com/wiki/LDAP%20ping – Skrymsli Nov 7 '19 at 23:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.