DNS協議 記錄類型 淺讀

DNS 協議學習簡單彙總

  DNS協議的歷史、設計的初衷在RFC 1034文章中起頭部分都有談到。下面正文主要講述DNS的大體功能、工做機制、DNS的多種解析記錄以及經常使用記錄分別表明的含義。html


DNS協議的做用:

  域名系統DNS是互聯網使用的命名系統,用來把便於人們使用的機器名字轉換成IP地址。Dns設計的初衷是爲了方便主機之間進行信息交互,Domain系統是DNS的核心控制部分,它主要是定義了 獲取數據的步驟(應該順着哪一個IP獲取或是順着哪一個DNS服務器接着查詢)。node


DNS系統的組成:

  DNS包含了如下的主要部分:緩存

  • Domain Name Space(域名空間)和Resource Record(資源記錄):   引用一段RFC文檔原文↓

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

Example name space

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 system

    CH              the Chaos system
  • TTL

    • 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

相關文章
相關標籤/搜索