contact contact

Unable to resolve host name localhost


Title: Unable to resolve host name localhost
Document: 1082487978
Author: Michael Marxmeier
Keywords: hpux,localhost,database

Acessing the database may fail with an error message like below:
  X0: Unable to resolve host name localhost
  Fatal error #-700 while opening database
  Secondary status = -2
  DBOPEN(9): REMOTE: Unable to connect server [-700:-2]

This message indicates a system configuration problem. Eloquence fails to translate the host name "localhost" (that indicates the local system) to the appropriate IP address (

Usually this indicates that DNS lookup of hostnames is configured for the system (the /etc/resolv.conf file specifies a list of nameservers) but the DNS server does not specify a localhost entry.

In addition the /etc/nsswitch.conf files does not specify a fallback to /etc/hosts (or the /etc/hosts configuration file does not include an entry for localhost).

How to fix it:

  • Make sure your /etc/hosts file has an appropriate entry for localhost (something like below)       localhost       loopback

  • Make sure your /etc/nsswitch.conf file specifies a fallback to /etc/hosts, for example
    hosts:        dns [NOTFOUND=continue] files

As a quick workaround the EQ_DBSERVER environment variable could be used to speify a default server of instead of the builtin default localhost. This avoids the lookup for localhost.

For example


  Privacy | Webmaster | Terms of use | Impressum Revision:  Thu Dec 30 20:52:43 2004  
  Copyright © 1995-2004 Marxmeier Software AG