免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: dolinux

[DNS] 关于DNS的递归查询和迭代查询 [复制链接]

论坛徽章:
0
发表于 2010-10-15 14:39 |显示全部楼层
本帖最后由 flyinweb_cu 于 2010-10-15 14:51 编辑
9楼的朋友你理解错误了吧?
请告诉我DNS查询中的递归与迭代在哪里有定义?RFC文档?或者ISC的Document中? ...
满天星 发表于 2010-10-14 12:57




http://www.rfc-archive.org/getrfc.php?rfc=1035 DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION

相关内容
RFC 5730 (Extensible Provisioning Protocol)
RFC 5731 (Domain Name Mapping)
RFC 5732 (Host Mapping)
RFC 5733 (Contact Mapping)
RFC 5734 (Transport Over TCP)
RFC 3735 (Guidelines for Extending EPP)
RFC 3915 (Domain Registry Grace Period Mapping)
RFC 4310 (Domain Name System (DNS) Security Extensions Mapping)


DNS RFC

征求意见文档 (RFC) 是由 Internet 团体使用的一系列正在完善的报告、协议建议和协议标准。域名系统 (DNS) 规范以 Internet 工程任务组 (IETF) 和其他工作组所发布的已批准的 RFC 为基础。

DNS 服务器服务的 RFC

下列 RFC 包含用来设计和实施 DNS 服务器和客户端服务的规范:


RFC         标题
1034 域名 - 概念和工具
1035 域名 - 实现和规范
1123 Internet 主机 - 应用和支持的要求
1886 支持 IP 版本 6 的 DNS 扩展名
1995 DNS 中的增量区域传输
1996 提示通知区域更改的机制 (DNS NOTIFY)
2136 域名系统中的动态更新 (DNS UPDATE)
2181 对 DNS 规范的说明
2308 DNS 查询的负缓存 (DNS NCACHE)
2535 域名系统安全扩展 (DNSSEC)
2671 DNS 的扩展机制 (EDNS0)
2782 指定服务位置的 DNS RR (DNS SRV)
2930 DNS 的密钥建立 (TKEY RR)
3645 DNS (GSS-TSIG) 密钥事务身分验证的通用安全服务算法
3646 IPv6 (DHCPv6) 动态主机配置协议的 DNS 配置选项

DNS 的其他规范

论坛徽章:
0
发表于 2010-10-15 17:15 |显示全部楼层
RFC 1034: http://www.rfc-editor.org/rfc/rfc1034.txt
RFC 1035: http://www.rfc-editor.org/rfc/rfc1035.txt
请找出迭代查询的概念定义部分,谢谢!至少我没看到……
其实4楼的朋友已经写出来了,RFC1034 4.3.1中有这样的描述:recursive的意思是迭代,但non-recursive就翻译为迭代?所以我觉得在大肆宣扬non-recursive是迭代查询的朋友恐怕在误导读者。不晓得是谁发明的这个迭代查询概念……

论坛徽章:
0
发表于 2010-10-15 18:03 |显示全部楼层
本帖最后由 flyinweb_cu 于 2010-10-15 18:05 编辑
RFC 1034:
RFC 1035:
请找出迭代查询的概念定义部分,谢谢!至少我没看到……
其实4楼的朋友已经写出来 ...
满天星 发表于 2010-10-15 17:15


rfc4697中有DNS iterative resolver说法
另外,MS官方有此提法(用Iteration这个词)
http://technet.microsoft.com/en-us/library/cc775637(WS.10).aspx

如果说定义吧,可能一本书上有说过(非RFC)
http://www.zytrax.com/books/dns/ch2/#iterative

论坛徽章:
0
发表于 2010-10-15 20:55 |显示全部楼层
回复 10# 满天星


    我想说的是在rfc中确实没有迭代的说法,是有non-recursiverecursive

两种说法,很显然recursive是递归,non-recursive是非递归,关于迭代的说法我觉得9楼的说的还是有一定的道理的,

这个还是需要自己理解了,重要的问题是明白  recursive和 non-recursive这两种查询方法的不同。

recursive:就是 A 问  B www.sina.com的A记录是多少?这时候b不能给出权威答案,
                 
                 但是B经过一番查询告诉A:1.1.1.1或者 找不到。

non-recursive: 就是A问B www.sina.com的A记录是多少? 然后B告诉A我不知道,但是你可以找C问问。

这个就是我的想法,第一种就是 递归, 第二种就是我认为的迭代(当然我们也可以不叫他迭代,取决于个人爱好吧)。

结论: 我认为不用再一个概念上纠缠很多,我们明白具体的查询过程就可以了。

论坛徽章:
0
发表于 2010-10-15 22:18 |显示全部楼层
我一直都是这样认为的,那就是只存在递归查询recursive与非递归查询non-recursive,



    的确。。俺也搞不清楚他们说的迭代查询是啥意思。

对于 dig www.aol.com @ns1.sina.com.cn
这个查询,能说他是迭代吗?

要么是递归 -- 这是一个DNS Cache.
要么是非递归 -- 只返回授权的或委派的应答。

论坛徽章:
0
发表于 2010-10-15 23:12 |显示全部楼层
并不是在一个概念上纠缠,而是既然不存在这个概念,我们为什么要误导初学者?就算有迭代这一说,我认为也就是3楼版主llzqq说的意见:只是递归查询的另一种叫法而已!

既然RFC的官方文档没有提到过这种概念,那么这个概念从何而来?很显然是中文翻译的时候产生的……但这样的翻译确实让人很费解,但如果用递归与非递归来解释就相当明白了!至少刚开始我不明白DNS查询原理时,根本理解不了“递归”与“迭代”有什么区别(严格说是记不住这二种名词的区别)……
《Linux系统管理员指南第二版》上的DNS章节:DNS查询要么是递归查询,要么是非递归查询!
至于其它书籍就不晓得了

论坛徽章:
0
发表于 2010-10-20 01:57 |显示全部楼层
本帖最后由 拉帮结派 于 2010-10-20 02:02 编辑

rfc 1034

In any system that has a distributed database, a particular
name server may be presented with a query that can only be
answered by some other server. The two general approaches to
dealing with this problem are "recursive", in which the first
server pursues the query for the client at another server, and
"iterative", in which the server refers the client to another
server and lets the client pursue the query
. Both approaches
have advantages and disadvantages, but the iterative approach
is preferred for the datagram style of access. The domain
system requires implementation of the iterative approach, but
allows the recursive approach as an option.

论坛徽章:
0
发表于 2010-10-20 02:16 |显示全部楼层
我理解这段话的意思就是迭代是首选、默认的查询方式,递归是一种可选的方式。
再看看1035中header的描述:
RD    Recursion Desired - this bit may be set in a query and
        s copied into the response. If RD is set, it directs
        the name server to pursue the query recursively.
        Recursive query support is optional.
RA    Recursion Available - this be is set or cleared in a
        response, and denotes whether recursive query support is
        available in the name server.

在header中没有迭代的开关选项,所以在有些书里包括rfc使用递归和非递归区别不同的查询方式,实际上非递归就是迭代。

论坛徽章:
0
发表于 2010-10-21 15:11 |显示全部楼层
迭代一词应是翻译自“Iteration”。
目前我没有发现RFC上有关于Iteration的说法。这一词应该出自于《DNS and Bind》5th edition这本书。见这本书的第2.6.2节 Recursion部分与2.6.3节Iteration部分。
  1. Queries come in two flavors, recursive and iterative, also called nonrecursive. Recursive queries place most of the burden of resolution on a single nameserver. Recursion, or recursive resolution, is just a name for the resolution process used by a nameserver when it receives recursive queries. As with recursive algorithms in programming, the nameserver repeats the same basic process (querying a remote nameserver and following any referrals) until it receives an answer.

  2. Iteration, or iterative resolution, on the other hand, refers to the resolution process used by a nameserver when it receives iterative queries.
复制代码
  1. Iterative resolution doesn't require nearly as much work on the part of the queried nameserver. In iterative resolution, a nameserver simply gives the best answer it already knows back to the querier. No additional querying is required. The queried nameserver consults its local data (including its cache, which we'll talk about shortly), looking for the data requested. If it doesn't find the answer there, it finds the names and addresses of the nameservers closest to the domain name in the query in its local data and returns that as a referral to help the querier continue the resolution process. Note that the referral includes all nameservers listed in the local data; it's up to the querier to choose which one to query next.
复制代码
从上面的文字可以看出,迭代(Iteration)即为递归查询Non-recursive的意思,就是DNS查询包中没有设置RD(Recursion Desired)位。

论坛徽章:
0
发表于 2010-10-21 22:49 |显示全部楼层
不要再说rfc里没有提到迭代,1034里有,另外还有13楼说的4697,
Abstract
This memo describes DNS iterative resolver behavior that results in a
significant query volume sent to the root and top-level domain (TLD)
name servers. We offer implementation advice to iterative resolver
developers to alleviate these unnecessary queries...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP