"gethostbyname returned a null host entry" on the ldap trace

  • 3301314
  • 14-Nov-2007
  • 26-Apr-2012

Environment

Novell eDirectory 8.7.3 for Linux and Unix
Novell eDirectory 8.8 for Linux and Unix

Situation

Cannot log in through LDAP in a container for which you don't have a R/W replica.
The follow error appears in a ldap tracd when this issue happens:
Updating server configuration
Listener applying new configuration
gethostbyname returned a null host entry
Configure LDAP referrals with NDS failure count = 1
TCP/IP is not configured correctly on this host
If you type "hostname" on the server command prompt you will see a different hostname or fqdn than in the /etc/hosts
#hostname
#perceus.olimpo.com
#cat /etc/hosts
#10.10.10.10 perceus.atenas.olimpo.com perceus

Resolution

You must have the server's correct hostname configured in /etc/hosts. Edit the file /etc/hosts or change your host name with the command "hostname your-hostname" to fix the issue.