The DNS provides an efficient way to convert human-readable names of IP end systems into machine-readable IP addresses necessary for routing.
DNS(網域名稱系統)提供一種有效率的方式,將人類可讀的 IP 端點系統名稱轉換成路由所需、機器可讀的 IP 位址。
On TCP/IP networks, hosts are assigned their unique 32-bit IPv4 addresses in the familiar dotted decimal notation to send and receive messages over the local network and the Internet. If there were no DNS, you would have to remember the IPv4 address of every host that you would like to reach.
在 TCP/IP 網路上,主機會被指派唯一的 32 位元 IPv4 位址,以我們熟悉的點分十進位表示法呈現,用於在區域網路與網際網路上收發訊息。如果沒有 DNS,你就必須記住每一台想要連線的主機的 IPv4 位址。
DNS uses a distributed database that is hosted on several servers, which are located around the world, to resolve the names that are associated with IP addresses. The DNS protocol defines an automated service that matches resource names with the required numeric network address.
DNS 使用分散在全球各地多台伺服器上代管的分散式資料庫,來解析與 IP 位址相關聯的名稱。DNS 協定定義了一種自動化服務,用來將資源名稱與所需的數字型網路位址進行比對。
An easy way to observe DNS in action can be performed in a command window in Microsoft Windows, Apple Mac OS X, or your favorite Linux distribution. When the command window is open, enter nslookup www.google.com. This command queries DNS to resolve the domain name into IP address. The result will appear below your query.
要輕鬆觀察 DNS 運作的方式,可以在 Microsoft Windows、Apple Mac OS X 或你喜歡的 Linux 發行版的命令視窗中操作。開啟命令視窗後,輸入 nslookup www.google.com。此指令會查詢 DNS,將網域名稱解析為 IP 位址,結果會顯示在查詢下方。
Your host sends a DNS query for the IP address of www.google.com. If your DNS server has the answer cached, it returns the answer directly.
你的主機會傳送 DNS 查詢,要求取得 www.google.com 的 IP 位址。如果你的 DNS 伺服器已將答案快取,就會直接回傳該答案。
The DNS system consists of DNS name space, Domain name registration, and Domain name resolution.
DNS 系統由 DNS 名稱空間、網域名稱註冊,以及網域名稱解析三個部分組成。
- DNS name space represents all names present in the DNS system. Names, such as www.google.com, are referred to as DNS domains or DNS domain names. DNS domain names are organized hierarchically in a multi-level architecture.DNS 名稱空間代表 DNS 系統中存在的所有名稱。像 www.google.com 這樣的名稱稱為 DNS 網域或 DNS 網域名稱。DNS 網域名稱以多層次架構進行階層式組織。
The architecture begins with a root name, which is common to all names. The root name then branches into multiple branches, with each branch starting with a different top-level domain name.
此架構從一個所有名稱共同擁有的根名稱開始,根名稱再分支出多條分支,每條分支以不同的頂層網域名稱開頭。
Each domain can have subdomains, which in turn can have subdomains of their own.
每個網域都可以擁有子網域,而子網域本身又可以擁有自己的子網域。
The complete name of the resource follows this structuring. Each level has its own name and the complete domain name is composed by aggregating names of all levels.
資源的完整名稱依循這種結構組成。每個層級都有自己的名稱,完整的網域名稱則是由各層級名稱組合而成。
- Domain name registration assigns a specific domain name to a particular resource and sets up relationships between names and addresses. The name registration process ensures that each name is unique.網域名稱註冊會將特定的網域名稱指派給特定資源,並建立名稱與位址之間的對應關係。名稱註冊程序可確保每個名稱都是唯一的。
To ensure uniqueness, name registration is regulated and supervised. The Internet Corporation for Assigned Names and Numbers (ICANN) operates the internet’s DNS. The registration process itself is not centralized but is shared among multiple authorized entities, called registries and registrars. Within DNS registration, authorized entities record assigned domain names and corresponding data into a database. DNS database is distributed among these different authorities. At the same time, the DNS information is stored and made available on DNS servers.
為確保唯一性,名稱註冊受到規範與監督。網際網路名稱與號碼指配公司(ICANN)負責營運網際網路的 DNS。註冊程序本身並非集中化,而是由多個稱為註冊管理機構(registry)與註冊商(registrar)的授權單位共同分擔。在 DNS 註冊過程中,授權單位會將指派的網域名稱與對應資料記錄到資料庫中。DNS 資料庫分散在這些不同的權責單位之間,同時 DNS 資訊也會儲存並公開於各 DNS 伺服器上。
- Domain name resolution is the process in which a resource name is resolved into a resource IP address. Domain name resolution happens on devices that are connected to the internet hundreds or thousands of times a day.網域名稱解析是將資源名稱解析為資源 IP 位址的程序。連線到網際網路的裝置每天都會進行數百次甚至數千次的網域名稱解析。
Users are usually unaware of the name resolution process. The process is integrated into the client programs, such as web browsers, email clients, or FTP clients. The clients accept domain name input by end users, use it to create name resolution requests, and send the requests to servers. Servers, on the other end, accept name resolution requests, look up the answers, and send the answers to the clients.
使用者通常不會察覺名稱解析的過程。此程序整合於用戶端程式中,例如網頁瀏覽器、電子郵件用戶端或 FTP 用戶端。這些用戶端會接受終端使用者輸入的網域名稱,用它建立名稱解析請求,並將請求傳送給伺服器。伺服器則在另一端接受名稱解析請求、查詢答案,並將答案傳送給用戶端。
In DNS, the resolution is implemented as a client and server process. It involves several entities of the system—DNS client, DNS servers of various types, and DNS distributed database. Clients and servers communicate by using the DNS protocol. The name resolution relies heavily on the information provided in the registration process. The process of resolution is also closely related to how the name space is structured. To find the information, the name resolution process resolves the given domain name one level at a time, until the final level is reached.
在 DNS 中,解析是以用戶端與伺服器程序來實作的,牽涉到系統中的多個實體——DNS 用戶端、各種類型的 DNS 伺服器,以及 DNS 分散式資料庫。用戶端與伺服器之間透過 DNS 協定通訊。名稱解析高度仰賴註冊程序中所提供的資訊,解析程序也與名稱空間的結構方式密切相關。為了找到資訊,名稱解析程序會一次解析給定網域名稱的一個層級,直到抵達最終層級為止。
The domain resolution process represents the practical side of the DNS system. The DNS name space and DNS registration create the basis and lay out the hierarchy for the name resolution.
網域解析程序代表 DNS 系統實際運作的一面。DNS 名稱空間與 DNS 註冊則建立了基礎,並為名稱解析建立階層結構。
The process starts when the client needs an IP address of the resource indicated by a name. The clients usually reside within the applications. These applications, such as web browsers, take the user’s input—a domain name from the textual input—and pass it to the DNS client residing on the device. The client creates the DNS query. It sends the query to its DNS server that is configured in the network settings for the network interface. The DNS server that accepts the query is the one that eventually responds with the requested data. The DNS server that receives the client’s query is called a recursive DNS resolver or just DNS resolver. DNS recursive resolver might already know the answer and send it immediately to the client. But this is not always the case. The DNS recursive resolver is still the one that should provide the answer to the client. Before it can do so, it must learn it through the DNS resolution process. The DNS resolution process can involve many entities and objects, such as DNS root name servers, DNS top level domain (TLD) name servers, zone information, resource records, referrals, DNS authoritative name servers, DNS database, and DNS cache. At the beginning of the process, there is a DNS query sent by the client. The DNS recursive resolver looks up the answer in a series of requests and responses until it reaches the authoritative server, which provides it. The recursive resolver then passes the answer to the client in a DNS response. DNS clients and DNS servers exchange queries and responses in DNS protocol messages.
此程序始於用戶端需要取得某名稱所指資源的 IP 位址。用戶端通常存在於應用程式之中,例如網頁瀏覽器這類應用程式會接收使用者輸入的文字(網域名稱),並將其傳遞給裝置上的 DNS 用戶端。用戶端會建立 DNS 查詢,並將其傳送給網路介面設定中所設定的 DNS 伺服器。接受查詢的 DNS 伺服器最終會負責回應所需的資料。接收用戶端查詢的 DNS 伺服器稱為遞迴 DNS 解析器(recursive DNS resolver),或簡稱 DNS 解析器。遞迴 DNS 解析器可能已經知道答案,並立即傳送給用戶端,但情況並非總是如此。遞迴 DNS 解析器仍然是負責提供答案給用戶端的角色,但在此之前,它必須透過 DNS 解析程序來取得答案。DNS 解析程序可能涉及許多實體與物件,例如 DNS 根名稱伺服器、DNS 頂層網域(TLD)名稱伺服器、區域資訊、資源記錄、轉介、DNS 權威名稱伺服器、DNS 資料庫,以及 DNS 快取。此程序開始時,用戶端會傳送一個 DNS 查詢,遞迴 DNS 解析器透過一連串的請求與回應查找答案,直到抵達提供答案的權威伺服器為止。接著,遞迴解析器會以 DNS 回應的形式,將答案傳回給用戶端。DNS 用戶端與 DNS 伺服器之間會以 DNS 協定訊息交換查詢與回應。


