2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose. It is provided "as is"
14 .\" without express or implied warranty.
16 .TH ARES_SEARCH 3 "24 July 1998"
18 ares_search \- Initiate a DNS query with domain search
23 .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
24 .B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP)
26 .B void ares_search(ares_channel \fIchannel\fP, const char *\fIname\fP,
27 .B int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
33 function initiates a series of single-question DNS queries on the name
34 service channel identified by
36 using the channel's search domains as well as a host alias file given
37 by the HOSTALIAS environment variable. The parameter
39 gives the alias name or the base of the query name as a NUL-terminated
40 C string of period-separated labels; if it ends with a period, the
41 channel's search domains will not be used. Periods and backslashes
42 within a label must be escaped with a backslash. The parameters
46 give the class and type of the query using the values defined in
47 .BR <arpa/nameser.h> .
48 When the query sequence is complete or has failed, the ares library
51 Completion or failure of the query sequence may happen immediately, or
52 may happen during a later call to
65 indicates whether the query sequence ended with a successful query
66 and, if not, how the query sequence failed. It may have any of the
70 A query completed successfully.
73 No query completed successfully; when the query was tried without a
74 search domain appended, a response was returned with no answers.
77 A query completed but the server claimed that the query was
81 No query completed successfully; when the query was tried without a
82 search domain appended, the server claimed to have experienced a
83 failure. (This code can only occur if the
84 .B ARES_FLAG_NOCHECKRESP
85 flag was specified at channel initialization time; otherwise, such
86 responses are ignored at the
91 No query completed successfully; when the query was tried without a
92 search domain appended, the server reported that the queried-for
93 domain name was not found.
96 A query completed but the server does not implement the operation
97 requested by the query. (This code can only occur if the
98 .B ARES_FLAG_NOCHECKRESP
99 flag was specified at channel initialization time; otherwise, such
100 responses are ignored at the
105 A query completed but the server refused the query. (This code can
106 only occur returned if the
107 .B ARES_FLAG_NOCHECKRESP
108 flag was specified at channel initialization time; otherwise, such
109 responses are ignored at the
114 No name servers responded to a query within the timeout period.
117 No name servers could be contacted.
120 Memory was exhausted.
123 The name service channel
125 is being destroyed; the query will not be completed.
127 The callback argument
129 reports how many times a query timed out during the execution of the
132 If a query completed successfully, the callback argument
134 points to a result buffer of length
136 If the query did not complete successfully,
138 will usually be NULL and
140 will usually be 0, but in some cases an unsuccessful query result may
146 Greg Hudson, MIT Information Systems
148 Copyright 1998 by the Massachusetts Institute of Technology.