̾??
resolver
—
??????????ե?????
resolver(3)
?ϥ????ͥåȥɥᥤ???͡??ॷ???ƥ??ؤΥ?????????????
C ?饤?֥????Υ롼???Ǥ???
??????????ե??????ϡ??Ϥ????ƥ???Х롼???ץ??????ˤ??äƸƤӽ?
???줿?Ȥ????ɤ߹??ޤ??????????ޤ??Ǥ??ޤ???
?ե??????Ͽʹ֤??ɤ????褦???߷פ????Ƥ??ꡢ?͡??ʼ????Υ???о?????
???롢?ͤĤ??Υ?????ɤΥꥹ?Ȥ??ޤ??Ǥ??ޤ???
???̤˹??????줿?????ƥ??Ǥϡ????Υե???????ɬ?פǤϤ????ޤ?????
?䤤???碌??????ͣ???Υ͡??ॵ???Фϥ????????ޥ??????ˤ??ꡢ?ۥ???̾
?????ɥᥤ??̾?????ꤵ?졢?ɥᥤ???θ????ѥ??????Υɥᥤ??̾????????
?????ޤ???
?͡??????ꥪ?ץ??????ϰʲ????̤??Ǥ???
- nameserver
- ????Ф??䤤???碌???͡??ॵ???ФΥ????ͥåȥ??ɥ쥹
(?ɥå?ɽ??)?Ǥ??? ??????????? 1
?ĤŤġ???
MAXNS
(?????Ǥ?
3)???ޤǤΥ͡??ॵ???Ф????ҤǤ??ޤ???
ʣ???Υ????Ф????Ҥ????Ƥ??????硢????Х饤?֥????ϵ??Ҥ??줿????
?䤤???碌???Ф??ޤ??? nameserver
?????ȥ꤬???Ҥ????Ƥ??ʤ????硢?ǥե????ȤǤϥ????????ޥ??????Υ͡???
?????Ф????Ѥ??ޤ?
(?????ǻȤ????륢?르?ꥺ???ϰʲ??Τ褦?ˤʤ??ޤ???
?ޤ????????͡??ॵ???Ф??䤤???碌?????ߤޤ???
?????䤤???碌???????ॢ???Ȥˤʤ??С?
???Υ͡??ॵ???Ф??䤤???碌?????ߡ????????͡??ॵ???Ф??ʤ??ʤ??ޤ?³???ޤ???
???????ʤ????硢???ΰ?Ϣ???䤤???碌?λ??ߤ????ȥ饤??????
????ã?????ޤǷ????֤??ޤ?)??
- domain
- ?????????ɥᥤ??̾??
???Υɥᥤ?????Ǥ?̾?????䤤???碌?ΤۤȤ??ɤ????????????ɥᥤ???ˤ?????
û??̾???????Ѥ??뤳?Ȥ??Ǥ??ޤ???
domain
?????ȥ꤬???Ҥ????Ƥ??ʤ????硢
gethostname(3)
???????????????ۥ???̾?????ɥᥤ???????ꤷ?ޤ???
?ɥᥤ?????Ϻǽ???
‘
.
’
?ʹߤ????ƤȤʤ??ޤ???
?ۥ???̾???ɥᥤ???????ޤ??Ǥ??ʤ????硢?ǽ?Ū?ˤ?
?롼?ȥɥᥤ???Ѥ????ޤ???
- search
- ?ۥ???̾Ĵ???Τ????θ????ꥹ?ȡ?
?̾?????ꥹ?Ȥϥ????????ɥᥤ??̾???????ꤵ???ޤ???
?ǥե????ȤǤϡ??????????ɥᥤ??̾?Τߤ??ޤߤޤ???
?????ꥹ?Ȥϡ? search
??????ɤθ??˥??ڡ????ޤ??ϥ??֤Ƕ??ڤ??줿
?ɥᥤ???ѥ?̾?????뤳?Ȥ?
?ѹ??Ǥ??ޤ???
?ۤȤ??ɤΥ???Ф??䤤???碌?ϡ??????ѥ??γƹ??????Ǥ????פ??륨???ȥ꤬
???Ĥ????ޤǽ??˻?ޤ???
???Ҥ??줿?ɥᥤ???Υ????Ф??????????ǤϤʤ????硢???ν???????®??¿????
?ͥåȥ???ȥ??ե??å???ȯ??????????ǽ???????뤳?Ȥȡ????????Τ????줫??
?ɥᥤ???˴ؤ??ơ????Ѳ?ǽ?ʥ????Ф?
1
?Ĥ?¸?ߤ??ʤ??????ˤ??䤤???碌??
?????ॢ???Ȥ??뤳?Ȥ????դ???ɬ?פ??????ޤ???
???ߤΤȤ??????????ꥹ?Ȥ? 6
?ɥᥤ?? 256
ʸ???????¤????ޤ???
- sortlist
- sortlist ???Ѥ??? gethostbyname
?ˤ????֤????륢?ɥ쥹???ȤǤ??ޤ???
sortlist ?? IP
???ɥ쥹?ȥͥåȥޥ??????Ȥǻ??ꤵ???ޤ???
?ͥåȥޥ????ϥ??ץ??????Ǥ??ꡢ
?ǥե????ȤΥͥåȥޥ????ϥͥåȤ??Ф??뼫???ʥͥåȥޥ???
(natural netmask) ?Ǥ??? IP
???ɥ쥹?ȥ??ץ??????Υͥåȥޥ??????Ȥϥ????å????Ƕ??ڤ??ޤ???
10 ?Ȥޤǻ?????ǽ?Ǥ???
???Ȥ??ơ?
sortlist
130.155.160.0/255.255.240.0 130.155.0.0
- options
- options
?ˤ???????Ф??????ѿ????????Ǥ??ޤ???
ʸˡ??
options option ...
?Ǥ??ꡢ
option
?ϰʲ??Τ????줫?Ǥ?:
- debug
- _res.options ??
RES_DEBUG
?????ꤷ?ޤ???
- ndots:n
- ?ǽ????????䤤???碌
???Ԥ????????ˡ?
res_query
()
(resolver(3)
????)
??Ϳ????????̾???˴ޤޤ????٤??ɥåȿ??????ͤ????ꤷ?ޤ???
n
?Υǥե????Ȥ? “1” ?Ǥ???
?????ϡ?̾?????˥ɥåȤ??????С?
search list
???Ǥ??ɲä????????ˡ?
????̾?????ޤ?????̾?Ȥ??ƻ???뤳?Ȥ???̣???ޤ???
- timeout:n
- ????Ф??㤦?͡??ॵ???Ф??䤤???碌?ˤ????ޤǤˡ?
???⡼?ȤΥ͡??ॵ???Ф????α??????ԤĽ??????֤????ꤷ?ޤ???
????Фϡ????ߤ??䤤???碌???Υ??ȥ饤???ˤϤ??ν??????֤?????
Ĺ?????ֱ??????ԤäƤ??褤?Ǥ???
?ʤ??ʤ顢?ؿ??ؿ?Ū?ʥХå????դ?
?????ॢ?????ͤ?Ŭ?Ѥ????뤫???Ǥ???
?ÿ??ǿ??????졢?ǥե????Ȥ?
RES_TIMEOUT
?Ǥ??ꡢ???Ĥ??????????ͤ?
RES_MAXRETRANS
(<resolv.h>
????)
?Ǥ???
- attempts:n
- ????Ф??????????ƸƤӽФ????Υ??ץꥱ?????????˥??顼???֤????ˡ?
?ƥ͡??ॵ???Ф˲????䤤???碌?????????뤫???ꤷ?ޤ???
?ǥե????Ȥ?
RES_DFLRETRY
?Ǥ??ꡢ???Ĥ??????????ͤ?
RES_MAXRETRY
(<resolv.h>
????)
?Ǥ???
- no_tld_query
- ????Ф˥ȥåץ??٥??Υɥᥤ??̾?????ʤ????ɥåȤ??????ʤ?̾????
???褷?ʤ??褦?ˤ????ޤ???
???Υ??ץ??????????Ѥ??Ƥ⡢????Ф?Ϳ?????줿̾???????Ѥ???ɸ????
domain ?? search
?Υ롼???˽??????Ȥ??ɤ????ȤϤǤ??ޤ?????
options ?? RES_OPTIONS
?Ķ??ѿ??????Ѥ??ơ??????ޤ??ϥ??ֶ??ڤ??Υꥹ?ȤȤ??ƻ????Ǥ??ޤ???
domain ?? search
??????ɤ???¾Ū?Ǥ???
???????Υ?????ɤ? 1
?İʾ嵭?Ҥ????Ƥ??????硢
?Ǹ??Υ?????ɤ?ͭ???ˤʤ??ޤ???
??????ɤ??ͤ?Ʊ???Ԥ?¸?ߤ???ɬ?פ????ꡢ???????
(?㤨?? nameserver)
?ϹԤ???Ƭ?ˤ???ɬ?פ??????ޤ???
?ͤϥ?????ɤ?³???ƶ????Ƕ??ڤäƵ??Ҥ??ޤ???
- /etc/resolv.conf
resolv.conf
?? /etc
??¸?ߤ??ޤ???
resolv.conf
?ե??????ե????ޥåȤ?
4.3BSD ???о줷?ޤ?????