1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
.\"WORD: resolver 쥾 ()
.\"WORD: override С饤
.\"WORD: call ƤӽФƤӽФ
.\"WORD: fully-qualified domain name ˵Ҥ줿ɥᥤ̾(FQDN)
.\"WORD: type
.\"WORD: class 饹
.\"WORD: query 䤤碌䤤碌
.\"WORD: buffer Хåե
.\"WORD: lower-level routines ̥롼
.\"WORD: limit of the array ϰ
.\"WORD: state information ֤ξ
.\"WORD: bitwise ``or'' ӥåñ̤
.\"WORD: True
.\"WORD: authoritative դ줿
.\"WORD: recursion desired bit ֤ӥå
.\"WORD: single component names ʬʤ̾
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\" Linux libc source code
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sun Jul 25 11:01:53 1993 by Rik Faith (faith@cs.unc.edu)
.\" Japanese Version Copyright (c) 1998 Shinji Orito all rights reserved.
.\" Translated Mon May 25 21:27:03 JST 1998
.\" by Shinji Orito <shinji@os.gulf.or.jp>
.TH RESOLVER 3 "May 21, 1993" "BSD" "Linux Programmer's Manual"
.SH ̾
res_init, res_query, res_search, res_querydomain, res_mkquery, res_send,
dn_comp, dn_expand \- 쥾С롼
.SH
.nf
.B #include <netinet/in.h>
.B #include <arpa/nameser.h>
.B #include <resolv.h>
.B extern struct state _res;
.sp
.B int res_init(void);
.sp
.BI "int res_query(const char *" dname ", int " class ", int " type ,
.RS
.BI "unsigned char *" answer ", int " anslen );
.RE
.sp
.BI "int res_search(const char *" dname ", int " class ", int " type ,
.RS
.BI "unsigned char *" answer ", int " anslen );
.RE
.sp
.BI "int res_querydomain(const char *" name ", const char *" domain ,
.RS
.BI "int " class ", int " type ", unsigned char *" answer ,
.BI "int " anslen );
.RE
.sp
.BI "int res_mkquery(int " op ", const char *" dname ", int " class ,
.RS
.BI "int " type ", char *" data ", int " datalen ", struct rrec *" newrr ,
.BI "char *" buf ", int " buflen );
.RE
.sp
.BI "int res_send(const char *" msg ", int " msglen ", char *" answer ,
.RS
.BI "int " anslen );
.RE
.sp
.BI "int dn_comp(unsigned char *" exp_dn ", unsigned char *" comp_dn ,
.RS
.BI "int " length ", unsigned char **" dnptrs ", unsigned char *" exp_dn ,
.BI "unsigned char **" lastdnptr );
.RE
.sp
.BI "int dn_expand(unsigned char *" msg ", unsigned char *" eomorig ,
.RS
.BI "unsigned char *" comp_dn ", unsigned char *" exp_dn ,
.BI "int " length );
.RE
.fi
.SH
δؿϥͥåȤΥɥᥤ͡ॵС䤤碌α
롣
.PP
\fBres_init()\fP ؿϡǥեȤΥɥᥤ̾硢͡ॵС
ɥ쥹뤿ե(resolv+(8))ɤࡣ
⤷СƤʤХۥȤ
ɥᥤƤʤХۥȤդ줿ɥᥤѤ롣
Ķѿ LOCALDOMAIN ǥС饤ɤǤ롣
\fBres_init()\fP ϡҤؿΤɤ줫ǽ˸ƤӽФ줿δؿ
¹Ԥ롣
.PP
\fBres_query()\fP ؿϡ˵Ҥ줿ɥᥤ̾(FQDN) (\fI\fP
\fI饹\fP\fI̾\fP) ͡ॵС䤤碌롣
ϡƤӽФ¦ˤäѰդĹ \fIanslen\fP \fIanswer\fP
Хåե˻Ĥ롣
.PP
\fBres_search()\fP ؿϡ䤤碌Ԥ \fBres_query()\fP Ʊͤα
ԤĤ˥ǥեȤƤ RES_DEFNAMES RES_DNSRCH ˤä
ꤵ븡롼ŬѤ롣( \fI_res\fP ץ)
.PP
\fBres_querydomain()\fP ؿ \fIname\fP \fIdomain\fP η
\fBres_query()\fP Ѥ䤤碌Ԥ
.PP
δؿϡ\fBres_query()\fP ǻȤ벼̥롼Ǥ롣
.PP
\fBres_mkquery()\fP ؿϡɥᥤ̾ \fIdname\fP ΰ٤ˡĹ \fIbuflen\fP
\fIbuf\fP 䤤碌å롣
䤤碌η \fIop\fP ̾ "QUERY" \fI<arpa/nameser.h>\fP
줿ΤɤǤɤ
\fInewrr\fP ϸѤƤʤ
.PP
\fBres_send()\fP ؿϡĹ \fImsglen\fP \fImsg\fP ˷줿
䤤碌 \fIanswer\fP Ĺ \fIanslen\fP β֤
ޤƤӽФƤʤ \fBres_init()\fP ƤӽФ
.PP
\fBdn_comp()\fP ؿϥɥᥤ̾ \fIexp_dn\fP ̤ơĹ \fIlength\fP
ΥХåե \fIcomp_dn\fP ¸롣
̤ˤϸߤΥåäư̤줿̾ؤΥݥ \fIdnptrs\fP Ѥ롣
ǽΥݥϥåƬؤΥꥹȤ NULL ǽ롣
ϰϤ \fIlastdnptr\fP Ƿ롣
\fIdnptr\fP NULL ʤХɥᥤ̾ϰ̤ʤ
\fIlastdnptr\fP NULL ʤСΥ٥ΥꥹȤϥåץǡȤʤ
.PP
\fBdn_expand()\fP ؿϡ̤줿ɥᥤ̾ \fIcomp_dn\fP 饵
\fIlength\fP \fIexp_dn\fP Хåեʥɥᥤ̾Ÿ롣
ΰ̤줿̾ϡ䤤碌ޤϱå˴ޤޤƤ
ơ \fImsg\fP åƬؤ
.PP
쥾С롼ϡ \fI<resolv.h>\fP 줿 \fI_res\fP ¤Τ
ޤޤƤŪȾ֤ξѤ롣
̾桼Ǥܤ \fI_res.options\fP Ǥ롣
ιܤϰʲΥץΥӥåñ̤¤ˤǤ롣
.sp
.TP
.B RES_INIT
\fBres_init()\fP ƤӽФƤп
.TP
.B RES_DEBUG
ǥХååϤ롣
.TP
.B RES_AAONLY
դ줿 (authoritative) Τ롣
\fBres_send()\fP ϡǽŪ˸դ줿뤫顼֤
ޤ³Ԥ롣
[Ƥʤ]
.TP
.B RES_USEVC
䤤碌 UDP ǡǤϤʤ TCP ³Ѥ롣
.TP
.B RES_PRIMARY
ץ饤ޥꡦɥᥤ͡ॵСΤ䤤碌롣
.TP
.B RES_IGNTC
ȥ顼(truncation errors)̵뤹롣 TCP ǥȥ饤ʤ
[Ƥʤ]
.TP
.B RES_RECURSE
֤ӥåȤ䤤碌ꤹ롣
֤ \fBres_send()\fP ǤϤʤɥᥤ͡ॵСˤäƹԤ롣
[ǥեȤͭ]
.TP
.B RES_DEFNAMES
ꤵƤС \fBres_search()\fP ϥǥեȤΥɥᥤ̾ʬ
Τߤʤ̾ʤɥåȤޤޤʤ̾դä롣
[ǥեȤͭ]
.TP
.B RES_STAYOPEN
䤤碌 TCP ³ݤĤ RES_USEVC ȶѤ롣
.TP
.B RES_DNSRCH
ꤵƤС \fBres_search()\fP ϸߤΥɥᥤӿƥɥᥤ
ۥ̾õΥץ
.BR gethostbyname (3) Ѥ롣
[ǥեȤͭ]
.SH ֤
\fBres_init()\fP ؿ 0 顼ȯ \-1 ֤
.PP
\fBres_query()\fP , \fBres_search()\fP , \fBres_querydomain()\fP
,\fBres_mkquery()\fP , \fBres_send()\fP ؿϱĹ֤
ޤ顼ȯ \-1 ֤
.PP
\fBdn_comp()\fP \fBdn_expand()\fP ؿϰ̤줿ɥᥤ̾Ĺ֤
ޤ顼ȯ \-1 ֤
.SH ե
.nf
/etc/resolv.conf 쥾ե
/etc/host.conf 쥾ե
.fi
.SH
BSD 4.3
.SH Ϣ
.BR gethostbyname (3),
.BR hostname (7),
.BR named (8),
.BR resolv+ (8)
|