title: LDAP listening on localhost but hostname or IP
body: <p>I've installed LDAP on a raspberryPI running Raspian, which is a Debian fork I think. </p>
  
  <p>I have a DB and entries and can do an LDAP search successfully from the server if I use -h localhost or -h 127.0.0.1. But if I use the hostname or IP I get an error message:</p>
  
  <pre><code>root@rpi1:~# ldapsearch -d 1 -x -h 10.10.0.11 -b "ou=Groups,dc=pi,dc=home"
  ldap_create
  ldap_url_parse_ext(ldap://10.10.0.11)
  ldap_sasl_bind
  ldap_send_initial_request
  ldap_new_connection 1 1 0
  ldap_int_open_connection
  ldap_connect_to_host: TCP 10.10.0.11:389
  ldap_new_socket: 4
  ldap_prepare_socket: 4
  ldap_connect_to_host: Trying 10.10.0.11:389
  ldap_pvt_connect: fd: 4 tm: -1 async: 0
  attempting to connect:
  connect errno: 111
  ldap_close_socket: 4
  ldap_err2string
  ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
  </code></pre>
  
  <p>The weird thing for me is that the service is running an listening on the port:</p>
  
  <pre><code>    root@rpi1:~# nmap 10.10.0.11
  
  Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-30 22:16 UTC
  Nmap scan report for rpi1.pi.home (10.10.0.11)
  Host is up (0.00017s latency).
  Not shown: 997 closed ports
  PORT    STATE SERVICE
  22/tcp  open  ssh
  80/tcp  open  http
  636/tcp open  ldapssl
  
  Nmap done: 1 IP address (1 host up) scanned in 26.78 seconds
  root@rpi1:~#
  root@rpi1:~#
  root@rpi1:~#
  root@rpi1:~#
  root@rpi1:~# nmap localhost
  
  Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-30 22:17 UTC
  Nmap scan report for localhost (127.0.0.1)
  Host is up (0.00018s latency).
  Other addresses for localhost (not scanned): 127.0.0.1
  Not shown: 996 closed ports
  PORT    STATE SERVICE
  22/tcp  open  ssh
  80/tcp  open  http
  389/tcp open  ldap
  636/tcp open  ldapssl
  
  Nmap done: 1 IP address (1 host up) scanned in 26.82 seconds
  </code></pre>
  
  <p>You can see that scanning localhost shows that the service is listening on 389, but not if I use the server's IP or hostname.</p>
  
  <p>So I have no way of getting a client on another server to connect, because it only seems to be listening on localhost..... This is beyond my limited understanding I'm afraid.</p>
  
  <p>As far as I can see I am resolving the name ok:</p>
  
  <pre><code>root@rpi1:~# host rpi1
  rpi1 has address 10.10.0.11
  
  root@rpi1:~# host rpi1.pi.home
  rpi1.pi.home has address 10.10.0.11
  
  root@rpi1:~# host ldap.pi.home
  ldap.pi.home has address 10.10.0.11
  </code></pre>
  
  <p>Proof that the DB is working:</p>
  
  <pre><code>root@rpi1:~# ldapsearch -x -h 127.0.0.1 -b "cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home"
  # extended LDIF
  #
  # LDAPv3
  # base &lt;cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home&gt; with scope subtree
  # filter: (objectclass=*)
  # requesting: ALL
  #
  
  # Bradley Atkins, musedev, Groups, pi.home
  dn: cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home
  cn: Bradley Atkins
  givenName: Bradley
  gidNumber: 501
  homeDirectory: /home/users/batkins
  sn: Atkins
  loginShell: /bin/sh
  objectClass: inetOrgPerson
  objectClass: posixAccount
  objectClass: top
  uidNumber: 1001
  uid: batkins
  
  # search result
  search: 2
  result: 0 Success
  
  # numResponses: 2
  # numEntries: 1
  </code></pre>
  
  <p>Can anyone suggest a way forward?</p>
  
  <p>thanks</p>