community.borland.com

Article #25546: What to check when you get GetHostbyName errors

Problem:
I am getting this error when I try to connect to a database 
on my server called "dopey":

I/O error during "gethostbyname" operation for file "dopey"
-unknown unix error 2

Solution:
**********************************************************************
Note:This information will work with all versions of InterBase
**********************************************************************


This error is a TCP/IP error that means that you do not have the 
entry for the server you are trying to connect to in your hosts 
file.   It is a text file that provides address locations of computers
that you can connect to with TCP/IP.  The format for  an entry in the
hosts file is the following:

hostname                IPADDRESS

for example:

dopey                     215.234.123.132

This means that the server called dopey is located at the address  215.234.123.132.
To see if the system is resolving this name correctly, use the ping command to
see if you can connect to dopey.

Type this command at the operating system prompt:
ping dopey


If this does not work, double check the entry listed in the hosts file.  

Another possibility that may trigger this error is multiple hosts files on your system.  
Search your system for occurances of the file called "hosts" . There should be only 
one such file on your system.


Note: 
The hosts file will be in the /etc directory on UNIX machines.
Under Windows95, it will be in your windows directory (c:windows
by default.)  
Under Windows NT, it will be in C:WINNTSYSTEM32driversetc.
where c:winnt was the directory where the operating system resides.

Last Modified: 26-OCT-00