Main Menu

KB#00260-How to solve an error 72, gethostbyaddr failure

Title:

How to solve an error 72, gethostbyaddr failure

Description:

Q: When I attempt to open a file via the Dataserver from a BBx TCP/IP client, I get an error 72. If I look at the Dataserver's logfile, it shows a single line that looks like: 

Sep 28 14:02:46: connect error, gethostbyaddr failed errno:0, h_errno:2 

Resolution:

A: The line in the logfile indicates that the Data Server could not resolve the client's name from its IP address. Here's an overview of what's happening: 

1) The client attempts to open a file via the Data Server 
2) The Data Server receives a connection attempt from the client 
3) The Data Server knows which machine made the request, as it knows the client's IP address 
4) The Data Server then tries to find out what the client's hostname is from its IP address 
5) This process fails, and the Data Server logs the result 
6) The client gives an error 72 for the OPEN 

Now, why is it that the Data Server couldn't find out what the client's hostname was if it had its IP address? First, a short discussion on how this is done. 

The Data Server can use one of two methods to do this. The first is via a hosts file, and the second is via DNS (a Domain Name Server). A hosts file is a simple text file that lists the local machine's hostname and IP address. With DNS, a server is setup to resolve hostnames and IP addresses for other machines. In this case, if a machine wants to find out a machine's IP based on its hostname, or its hostname based on its IP address, it will ask the DNS server. The DNS server will look up the desired information in its database, and provide the correct result. Note that the DNS server provides two services--name resolution from IP address, and IP address resolution from hostname. 

So, the gethostbyaddr failure indicates that the server that is running the Data Server cannot resolve the client's hostname from its IP address. This means that either there is a problem with the hosts file or a problem with the DNS, depending on which method is being used. If you are using a hosts file, make sure that it contains an entry for the client. This entry should have the full hostname and IP address. If you are using DNS, then it means that it cannot resolve hostnames from IP addresses. This is not an uncommon problem! It is also an easy one to miss as pings, telnets, and nslookups will still work correctly if you use the hostname as an argument. Then solution is to configure the DNS to allow hostname lookups based on IP Address. 

Here's a quick test to see if DNS is configured correctly: 

1) From the Unix host, type in "nslookup" without the quotes. 
2) At the > prompt, type in the client's hostname. If all is well, it will return the client's IP address. 
3) At the > prompt, type in the client's IP address If all is well, it will return the client's hostname. If not, then DNS must be configured to resolve the client's hostname from its IP address, or BBx will not be able to open a file via the Data Server. 



Last Modified: 12/30/1997 Product: PRO/5 Data Server Operating System: All platformsError Number: 72

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel