DNS协议
的历史、设计的初衷在RFC 1034文章中起头部分都有谈到。下面正文主要讲述DNS
的大体功能、工做机制、DNS
的多种解析记录以及经常使用记录分别表明的含义。html
域名系统DNS是互联网使用的命名系统,用来把便于人们使用的机器名字转换成IP地址。Dns设计的初衷是为了方便主机之间进行信息交互,Domain系统是DNS的核心控制部分,它主要是定义了 获取数据的步骤(应该顺着哪一个IP获取或是顺着哪一个DNS服务器接着查询)。node
DNS包含了如下的主要部分:缓存
The DOMAIN NAME SPACE and RESOURCE RECORDS, which are specifications for a tree structured name space and data associated with the names. Conceptually, each node and leaf of the domain name space tree names a set of information, and query operations are attempts to extract specific types of information from a particular set服务器
简单描述就是域名空间下使用的树状结构存储的各类资源记录以及访问资源记录的路径(方法,由于有些资源可能当前的DNS服务器上没有记录)dom
NAME SERVERS(命名服务器): Name Server就是运行持有域名空间以及资源文件的管理程序,其一般缓存了关于部分域内的资源记录以及访问其余Dns服务器的路径。通常状况上Dns服务器会保存了某个域(子域)的完整资源信息以及一些从任意地方都能访问到特定资源(此服务器不含有的资源)的指针,这一类有着完整的域名信息的服务器有着别名,叫作:权威服务器。权威服务器上的资源是以'区'为单位管理的,这些区内信息否会分散在更多其余的Dns服务器上,冗余提供服务。分布式
RESOLVERS (处理者): Resolver 就是指代的那些从Name Server 中提取所需信息,响应解析请求的处理对象。它依赖于DNS Name Server,是与请求接触(Access)的直接对象,而且也是它来决定这次请求是否还须要引用其余的DNS Name Server 。从概念上理解,它的做用有点像 System Router
。在Resolver与用户的程序(User Programm)之间的不该该采用任何约定ide
A resolver will typically be a system routine that is directly accessible to user programs; hence no protocol is necessary between the resolver and the user program.学习
域名空间(Domain Name Space)中,资源(Resource Set)都是以树上的叶子(leaf)或者是内部节点(Inner Node)的形式保存在树形结构中的。Domain System对叶子以及内部节点并无很详细的去划分所以能够统称这二者为节点。每一个节点都有一个label,长度为63字节,兄弟节点的的label内容是不容许相同的,而且规定了节点的遍历方式是从左往右的(中序遍历,笔者猜想的),每次便利到节点的值便在后面补上一个.
,所以 Resolver 提取的信息每每都是由数个节点的值以及.
构成的(笔者猜想的,请求的域名的资源记录即是存放在对应的叶子节点中)this
Note that while upper and lower case letters are allowed in domain names, no significance is attached to the case. That is, two names with the same spelling but different case are to be treated as if identical.spa
节点就是由一个一个域名惟一标识的,而且于这个域名相关的资源信息(RRs)的组成大体为:
owner
- which is the domain name where the RR is found.
type
which is an encoded 16 bit value that specifies the type of the resource in this resource record.
Types refer to abstract resources.This memo uses the following types:
A a host address CNAME identifies the canonical name of an alias HINFO identifies the CPU and OS used by a host MX identifies a mail exchange for the domain. See [RFC-974 for details. NS the authoritative name server for the domain PTR a pointer to another part of the domain name space SOA identifies the start of a zone of authority]class
- which is an encoded 16 bit value which identifies a protocol family or instance of a protocol. - This memo uses the following classes:
IN the Internet systemCH the Chaos systemTTL
- which is the time to live of the RR.
This field is a 32 bit integer in units of seconds, an is primarily used by resolvers when they cache RRs.
The TTL describes how long a RR can be cached before it should be discarded.
RDATA
which is the type and sometimes class dependent data
which describes the resource:
A For the IN class, a 32 bit IP address For the CH class, a domain name followed by a 16 bit octal Chaos address. CNAME a domain name. MX a 16 bit preference value (lower is better) followed by a host name willing to act as a mail exchange for the owner domain. NS a host name. PTR a domain name. SOA several fields.
总体采用的即是分布式的结构:
持续更新ing .....
修改时间: 2018/05/29