dns名称解析过程[中文]


所属类别:Linux

文章作者:zxzcccc

特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!


Solaris - dns名称解析过程[中文][译]Samhoo本文的目的在于阐述DNS名称解析过程。为了给出一个例子,我们假设某个用户试图从客户机ftp到ftp.internic.net。该客户机将经历如下解析步骤:1.客户机根据/etc/nsswitch.conf文件来确定名字解析的顺序。在本例中,假定的顺序是:首先是本地文件,其次NIS+服务器,最后是DNS。2.客户机查找本地/etc/inet/hosts文件,没有发现匹配项。3.客户机向NIS+服务器发起关于ftp.internic.net地址的查询,仍然没有找到。4.客户机根据/etc/resolv.conf文件确定名称解析搜索列表和本地DNS服务器的地址。5.客户机解析例程向本地DNS服务器发起一个递归的DNS查询,以返回ftp.intenic.net的地址。这次,客户机将阻塞直到本地DNS服务器完成名称解析。6.如果该查询最近出现过,本地DNS服务器首先会检查缓冲。如果该查询结果在本地缓冲里,它向客户机返回一个非权威的查询结果7.本地DNS服务器向负责internic.net域查询的DNS服务器(如果没有适当的DNS服务器就向根服务器)发起一个交互查询。在本例中,我们假设缓冲中没有所需的查询结果,而且根服务器服务于我们的查询。8.根服务器返回最接近的信息。这样,你只能从根服务器得到的所有net.服务器的名称和地址。根服务器返回的这些名称和地址还包含了维持时间(time-to-alive),维持时间用于通知本地域名服务器,这些名称和地址可以缓冲多长时间。9.本地DNS服务器向上一步查询返回的net.服务器的其中之一发起查询,查询的过程与上述向根服务器进行的交互查询是一样的。10.net.服务器返回最为接近的信息--internic.net.服务器的地址和名称及其维持时间(time-to-live)。11.本地DNS服务器向其中的一个internic.net.服务器发起相同的查询。12.internic.net.服务器返回ftp.internic.net的地址及其维持时间(time-to-live)。13.本地DNS服务器向客户机返回所请求的地址,然后就可以处理ftp命令。14.本地DNS服务器将缓冲ftp.internic.net的地址用于以后的查询。附原文:ThepurposeofthisinfodocistoexplaintheDNSNameResolutionProcess.Touseanexample,let'ssayauseristryingtoftptoftp.internic.netfromaclientmachine.Theclientmachineresolutionprocessusesthefollowingsteps:1.Theclientsystemconsultsthe/etc/nsswitch.conffiletodeterminethenameresolutionorder.Inthisexample,thepresumedorderislocalfilesfirst,NIS+serversecond,andDNSthird.2.Theclientsystemconsultsthelocal/etc/inet/hostsfileanddoesnotfindanentry.3.Theclientsystemsendsaqueryregardingtheaddressofftp.internic.nettotheNIS+serverandfindsnone.4.Theclientsystemconsultsthe/etc/resolv.conffiletodeterminethenameresolutionsearchlistandtheaddressofthelocalDNSserver.5.TheclientsystemresolverroutinessendarecursiveDNSqueryregardingthereturnaddressofftp.internic.nettothelocalDNSserver.Atthispoint,theclientwillwaituntilthelocalserverhascompletednameresolution.6.ThelocalDNSserverconsultsthecontentsofitscachedinformationincasethisqueryhasbeentriedrecently.Iftheanswerisinlocalcache,itisreturnedtotheclientasanon-authoritativeanswer.7.ThelocalDNSservercontactstheappropriateDNSserverfortheinternic.netdomain(ifknown)orarootserver,andsendsaniterativequery.Inthisexample,theassumptionisthattheanswerisnotcachedandrootservermustbecontacted.8.Therootserverreturnsthebestinformationithas.Inthiscase,theonlyinformationyoucanbeguaranteedthattherootserverwillhaveisthenamesandaddressesofallthenet.servers.Therootserverreturnsthesenamesandaddressesalongwithatime-to-livevaluespecifyinghowlongthelocalnameservercancachethisinformation.9.ThelocalDNSservercontactsoneofthenet.serversreturnedfromthepreviousquery,andtransmitsthesameiterativequerysenttotherootserversearlier.10.Thenet.servercontactedreturnsthebestinformationithas,whichisthenamesandaddressesoftheinternic.net.serversalongwithatime-to-livevalue.11.ThelocalDNSservercontactsoneoftheinternic.net.serversandmakesthesamequery.12.Theinternic.net.serversreturntheaddressoftheftp.internic.netalongwiththetime-to-livevalue.13.ThelocalDNSserverreturnstherequestedaddresstotheclientsystemandtheftpcommandcanproceed.14.Nowthisaddressforftp.internic.netwillbecachedinlocalDNSserverforfuturequeries.Linux联盟收集整理原文地址 http://www.xxlinux.com/linux/article/unix/rumen/2006-07-19/2940.html

相关信息

· 黑客经验谈之SA权限入侵的感悟

· 用聊天软件发送免费短信全接触

· Error: XDMCP connection failed

· C








....

63965 73779