Resolver return codes

This section describes the return codes returned by the resolver. Table 1 describes the return codes for the getaddrinfo, getnameinfo, and freeaddrinfo resolver APIs. Return codes for the gethostbyname and gethostbyaddr resolver APIs are described in Table 2.

Table 1. Resolver return codes for getaddrinfo, getnameinfo, and freeaddrinfo
Code Name Description Programmer's response
1 EAI_NONAME This can be one of the following situations:
  • The name does not resolve for the supplied parameters.
  • Neither hostname nor servicename were supplied.
Check the validity of function parameters, TCPIP.DATA values, DNS definitions, or local host file (for example, etc.ipnodes). Also, ensure that your TCP/IP stack is active.
2 EAI_AGAIN The name could not be resolved at this time. Future attempts might succeed. The function is not able to complete, but the condition might not last a long time. Another call attempt can be tried almost immediately. Also, ensure that your resolver is active.
3 EAI_FAIL A non-recoverable error occurred when attempting to resolve the name. Check the validity of function parameters and TCPIP.DATA values.
4 EAI_OVERFLOW The output buffer for the host name or service name was too small. Increase the size of the buffer. Use the associated reason code to determine which buffer was too small.
5 EAI_FAMILY The address family was not recognized or the address length was invalid length for the specified family. Check the validity of function parameters.
6 EAI_MEMORY There was a memory allocation failure when trying to allocate storage. Increase the user storage allocation for this job.
7 EAI_BADFLAGS The flags parameter had an invalid value. Check the validity of function parameters.
8 EAI_SERVICE The service passed was not recognized for the specified socket type. Check the validity of function parameters, and local services file (for example, /etc/services or etc.services)
9 EAI_SOCKTYPE The intended socket type was not recognized. Check the validity of function parameters.
Table 2. Resolver return codes for gethostbyname and gethostbyaddr
Code Name Description Programmer's response
1 HOST_NOT_ FOUND The name specified is unknown, the address domain specified is not supported, or the address length specified is not valid. Check the validity of function parameters, TCPIP.DATA values, and DNS definitions.
2 TRY_AGAIN Temporary error; information not currently accessible. The function is not able to complete, but the condition might not last a long time. Another call attempt can be tried almost immediately. Also, ensure that your resolver is active.
3 NO_RECOVERY Unrecoverable error occurred. Check the validity of function parameters and TCPIP.DATA values.
4 NO_DATA There is no data of the requested type for the host name. Check the validity of function parameters, TCPIP.DATA values, and DNS definitions.