The res_send() call sends a query to a local name server.
Syntax
#include <types.h> #include <netinet\in.h> #include <arpa\nameser.h> #include <resolv.h> int res_send(msg, msglen, ans, anslen) char *msg; int msglen; char *ans; int anslen;
Parameters
msg
Description
This call sends a query to the local name server and calls the res_init() call if the RES_INIT option of the global _res structure is not set. It also handles timeouts and retries.
The res_send() call is one of a set of calls that form the resolver. The resolver is a group of functions that perform a translation between domain names and network addresses. Global information used by the resolver calls resides in the _res data structure. The <RESOLV.H> file contains the _res data structure definition. (See The _res Data Structure for more on the _res data structure.)
Return Values
When successful, the call returns the length of the message. When unsuccessful, the call returns a value of -1.
Related Calls
dn_comp() dn_expand()
dn_find()
dn_skipname()
putlong()
putshort()
res_init()
res_mkquery()
res_query()
res_search()