1 .\" $Id: ares_query.3,v 1.1 1998/08/13 18:07:34 ghudson Exp $
3 .\" Copyright 1998 by the Massachusetts Institute of Technology.
5 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose. It is provided "as is"
15 .\" without express or implied warranty.
17 .TH ARES_QUERY 3 "24 July 1998"
19 ares_query \- Initiate a single-question DNS query
24 .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP,
25 .B unsigned char *\fIabuf\fP, int \fIalen\fP)
27 .B void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP,
28 .B int \fIclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
34 function initiates a single-question DNS query on the name service
39 gives the query name as a NUL-terminated C string of period-separated
40 labels optionally ending with a period; periods and backslashes within
41 a label must be escaped with a backslash. The parameters
45 give the class and type of the query using the values defined in
46 .BR <arpa/nameser.h> .
47 When the query is complete or has failed, the ares library will invoke
49 Completion or failure of the query may happen immediately, or may
50 happen during a later call to
63 indicates whether the query succeeded and, if not, how it failed. It
64 may have any of the following values:
67 The query completed successfully.
70 The query completed but contains no answers.
73 The query completed but the server claims that the query was
77 The query completed but the server claims to have experienced a
78 failure. (This code can only occur if the
79 .B ARES_FLAG_NOCHECKRESP
80 flag was specified at channel initialization time; otherwise, such
81 responses are ignored at the
86 The query completed but the queried-for domain name was not found.
89 The query completed but the server does not implement the operation
90 requested by the query. (This code can only occur if the
91 .B ARES_FLAG_NOCHECKRESP
92 flag was specified at channel initialization time; otherwise, such
93 responses are ignored at the
98 The query completed but the server refused the query. (This code can
100 .B ARES_FLAG_NOCHECKRESP
101 flag was specified at channel initialization time; otherwise, such
102 responses are ignored at the
109 could not be encoded as a domain name, either because it contained a
110 zero-length label or because it contained a label of more than 63
114 No name servers responded 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 If the query completed (even if there was something wrong with it, as
128 indicated by some of the above error codes), the callback argument
130 points to a result buffer of length
132 If the query did not complete,
140 Greg Hudson, MIT Information Systems
142 Copyright 1998 by the Massachusetts Institute of Technology.