Standards / Extensions | C or C++ | Dependencies |
---|---|---|
BSD 4.3 |
both | OS/390 V2R8 |
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int res_query(const char *dname, int class, int type, u_char *answer, int anslen);
This routine is one of several functions used for making, sending and interpreting query and reply messages with Internet domain name servers (DNS).
The res_query() function provides an interface to the server query mechanism. It constructs a query, sends it to the local server, awaits a response, and makes preliminary checks on the reply. The query requests information of the specified type and class for the specified fully-qualified domain name dname. The reply message is left in the answer buffer with length anslen supplied by the caller.
If successful, res_query() returns the reply message in the answer buffer with length anslen.