Sends a query to a name server and retrieves a response.
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h>
int res_send (MessagePtr, MessageLength, Answer, AnswerLength) char *MsgPtr; int MsgLength; char *Answer; int AnswerLength;
The res_send subroutine sends a query to name servers and calls the res_init subroutine if the RES_INIT option of the _res structure is not set. This subroutine sends the query to the local name server and handles time outs and retries.
The res_send subroutine is one of a set of subroutines that form the resolver, a set of functions that resolve domain names. Global information used by the resolver subroutines is kept in the _res structure. The /usr/include/resolv.h file contains the _res structure definition.
Upon successful completion, the res_send subroutine returns the length of the message.
If the res_send subroutine is unsuccessful, the subroutine returns a -1.
The res_send subroutine is part of Base Operating System (BOS) Runtime.
All applications containing the res_send subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
/etc/resolv.conf | |
Contains general name server and domain name information. |
The dn_comp subroutine, dn_expand subroutine, _getlong subroutine, _getshort subroutine, putlong subroutine, putshort subroutine, res_init subroutine, res_mkquery subroutine, res_query subroutine, res_search subroutine.
Sockets Overview and Understanding Domain Name Resolution in AIX Version 4.3 Communications Programming Concepts.