query a local server, using search options
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> int res_search( char *dname, int class, int type, u_char *answer, int anslen );
The res_search() routine makes an Internet domain name search. Like res_query(), res_search() makes a query and waits for a response. But it also implements the default and search rules controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the first successful reply.
The resolver routines are used for making, sending, and interpreting query and reply messages with Internet domain name servers.
Global configuration and state information used by the resolver routines is kept in the structure _res. For more information on the options, see res_init().
The length of a reply message, in bytes, or -1 if an error occurs (h_errno is set).
See herror().
UNIX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
dn_comp(), dn_expand(), gethostbyname(), herror(), res_init(), res_mkquery(), res_query(), res_send()
/etc/resolv.conf, hostname, named in the TCP/IP User's Guide
RFC 1032, RFC 1033, RFC 1034, RFC 1035, RFC 974