title: Passport-ldapauth: Error: getaddrinfo ENOTFOUND
body: <p>This is how i set up my passport-ldapauth strategy:</p>
  <pre><code>let OPT = {
      server: {
          url: 'ldap://****:389',
          bindDN: &quot;&quot;,
          bindCredentials: &quot;&quot;,
          searchBase: 'ou=Users,dc=astron,dc=hu',
          searchFilter: &quot;(uid={{username}})&quot;
      },
      usernameField: 'username',
      passwordField: 'password',
  };
  passport.use(new LdapStrategy(OPT, function (user, done) {
      if (user != null) {
          return done(null, user);
      } else return done(new Error(&quot;i dont know&quot;), null)
  }))
  app.use(passport.initialize())
  </code></pre>
  <p>This is where is use it:</p>
  <pre><code> async authenticate(req, res): Promise &lt; boolean &gt; {
           return new Promise &lt; boolean &gt; ((resolve,
                       reject) =&gt; {
                       let authenticate: express.RequestHandler = &lt;express.RequestHandler&gt;passport.authenticate('ldapauth', (error, user, info) =&gt; {
                  if (error) {
                      return reject(error);
                  }
                  if (!user) {
                      return resolve(false);
                  }
                  req.user = user;
                  resolve(true);
              });
              authenticate(req, res,
                  null);
          }
          )
      }
  </code></pre>
  <p>And i get this error:</p>
  <blockquote>
  <p>Error: getaddrinfo ENOTFOUND **** ****:389</p>
  <p>at errnoException (dns.js:28:10)</p>
  <p>at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)</p>
  </blockquote>
  <p>My question would be why do i get the error? I am sure the url and the username/password is correct.</p>