Internet Technologies 简明教程
Internet Domain Name System
Overview
在 DNS 还不存在时,人们必须下载包含主机名及其对应 IP 地址的 Host file 。但随着互联网主机数量的增加,主机文件的大小也增加了。这导致下载此文件时流量增加。为了解决这个问题,引入了 DNS 系统。
When DNS was not into existence, one had to download a Host file containing host names and their corresponding IP address. But with increase in number of hosts of internet, the size of host file also increased. This resulted in increased traffic on downloading this file. To solve this problem the DNS system was introduced.
Domain Name System 帮助将主机名解析为一个地址。它使用一种分层命名方案和分布式 IP 地址和关联名称数据库。
Domain Name System helps to resolve the host name to an address. It uses a hierarchical naming scheme and distributed database of IP addresses and associated names
IP Address
IP 地址是一个分配给网络上机器的唯一逻辑地址。IP 地址具有以下属性:
IP address is a unique logical address assigned to a machine over the network. An IP address exhibits the following properties:
-
IP address is the unique address assigned to each host present on Internet.
-
IP address is 32 bits (4 bytes) long.
-
IP address consists of two components:* network component* and host component.
-
Each of the 4 bytes is represented by a number from 0 to 255, separated with dots. For example 137.170.4.124
Uniform Resource Locator (URL)
Uniform Resource Locator (URL) 指的是一个 web 地址,它唯一地标识了互联网上的一个文档。
Uniform Resource Locator (URL) refers to a web address which uniquely identifies a document over the internet.
例如, www.tutorialspoint.com/internet_technology/index.html 是一个指向 index.html 的 URL,该文件存储在 tutorialspoint web 服务器的 internet_technology 目录下。
For example, www.tutorialspoint.com/internet_technology/index.html is an URL to the index.html which is stored on tutorialspoint web server under internet_technology directory.
URL Types
有两种形式的 URL,如下所示:
There are two forms of URL as listed below:
-
Absolute URL
-
Relative URL
绝对 URL 是 web 上某个资源的完整地址。此完整地址包括使用的协议、服务器名称、路径名称和文件名。
Absolute URL is a complete address of a resource on the web. This completed address comprises of protocol used, server name, path name and file name.
For example http:// www.tutorialspoint.com / internet_technology /index.htm. where:
-
http is the protocol.
-
tutorialspoint.com is the server name.
-
index.htm is the file name.
协议部分告诉 web 浏览器如何处理文件。同样,我们还有其他一些协议,可用于创建 URL:
The protocol part tells the web browser how to handle the file. Similarly we have some other protocols also that can be used to create URL are:
-
FTP
-
https
-
Gopher
-
mailto
-
news
相对 URL 是网页的部分地址。与绝对 URL 不同,相对 URL 省略了协议和服务器部分。
Relative URL is a partial address of a webpage. Unlike absolute URL, the protocol and server part are omitted from relative URL.
例如,要链接到 tutorialspoint.com/internet_technology/internet_referemce_models 上的图像,我们可以使用相对 URL,格式如下 /internet_technologies/internet-osi_model.jpg.
For example, to link an image on tutorialspoint.com/internet_technology/internet_referemce_models, we can use the relative URL which can take the form like /internet_technologies/internet-osi_model.jpg.
Difference between Absolute and Relative URL
Absolute URL |
Relative URL |
Used to link web pages on different websites |
Used to link web pages within the same website. |
Difficult to manage. |
Easy to Manage |
Changes when the server name or directory name changes |
Remains same even of we change the server name or directory name. |
Take time to access |
Comparatively faster to access. |
Domain Name System Architecture
域名系统包含 Domain Names, Domain Name Space, Name Server ,如下所述:
The Domain name system comprises of Domain Names, Domain Name Space, Name Server that have been described below:
Domain Names
域名是与 IP 地址关联的符号字符串。有许多可用的域名;其中一些是通用的,例如 com, edu, gov, net 等,而另一些是国家级域名,例如 au, in, za, us 等。
Domain Name is a symbolic string associated with an IP address. There are several domain names available; some of them are generic such as com, edu, gov, net etc, while some country level domain names such as au, in, za, us etc.
下表显示了 Generic 顶级域名:
The following table shows the Generic Top-Level Domain names:
Domain Name |
Meaning |
Com |
Commercial business |
Edu |
Education |
Gov |
U.S. government agency |
Int |
International entity |
Mil |
U.S. military |
Net |
Networking organization |
Org |
Non profit organization |
下表显示了 Country top-level 域名:
The following table shows the Country top-level domain names:
Domain Name |
Meaning |
au |
Australia |
in |
India |
cl |
Chile |
fr |
France |
us |
United States |
za |
South Africa |
uk |
United Kingdom |
jp |
Japan |
es |
Spain |
de |
Germany |
ca |
Canada |
ee |
Estonia |
hk |
Hong Kong |
Domain Name Space
域名空间是指互联网命名结构中的层次结构。此层次结构具有多级(从 0 到 127),顶部有一个根节点。下图显示了域名空间层次结构:
The domain name space refers a hierarchy in the internet naming structure. This hierarchy has multiple levels (from 0 to 127), with a root at the top. The following diagram shows the domain name space hierarchy:
在上图中,每个子树代表一个域。每个域都可以细分为子域,这些子域又可以进一步细分,依此类推。
In the above diagram each subtree represents a domain. Each domain can be partitioned into sub domains and these can be further partitioned and so on.
Name Server
名称服务器包含 DNS 数据库。此数据库包含各种名称及其对应的 IP 地址。由于一台服务器不可能维护整个 DNS 数据库,因此,这些信息分布在许多 DNS 服务器之间。
Name server contains the DNS database. This database comprises of various names and their corresponding IP addresses. Since it is not possible for a single server to maintain entire DNS database, therefore, the information is distributed among many DNS servers.
Zones
区域是在主域下收集的节点(子域)。服务器为每个区域维护一个名为区域文件的文件。
Zone is collection of nodes (sub domains) under the main domain. The server maintains a database called zone file for every zone.
有关子域中节点的信息存储在较低级别的服务器上;但是,原始服务器保留了对该等较低级别的服务器的引用。
The information about the nodes in the sub domain is stored in the servers at the lower levels however; the original server keeps reference to these lower levels of servers.
以下是对整个域名系统进行管理的三类名称服务器:
Following are the three categories of Name Servers that manages the entire Domain Name System:
-
Root Server
-
Primary Server
-
Secondary Server
根服务器是顶级服务器,包含整个 DNS 树。它不包含有关域名的信息,而是将权限委派给其他服务器
Root Server is the top level server which consists of the entire DNS tree. It does not contain the information about domains but delegates the authority to the other server
主服务器存储有关其区域的文件。它有权创建、维护和更新区域文件。
Primary Server stores a file about its zone. It has authority to create, maintain, and update the zone file.
从服务器从另一台服务器(该服务器可以是主服务器或从服务器)传输有关某个区域的完整信息。从服务器无权创建或更新区域文件。
Secondary Server transfers complete information about a zone from another server which may be primary or secondary server. The secondary server does not have authority to create or update a zone file.
DNS Working
DNS 自动将域名转换为 IP 地址。以下步骤将引导您完成域名解析过程中的步骤:
DNS translates the domain name into IP address automatically. Following steps will take you through the steps included in domain resolution process:
-
When we type www.tutorialspoint.com into the browser, it asks the local DNS Server for its IP address.
-
When the local DNS does not find the IP address of requested domain name, it forwards the request to the root DNS server and again enquires about IP address of it.
-
The root DNS server replies with delegation that I do not know the IP address of www.tutorialspoint.com but know the IP address of DNS Server.
-
The local DNS server then asks the com DNS Server the same question.
-
The com DNS Server replies the same that it does not know the IP address of www.tutorialspont.com but knows the address of tutorialspoint.com.
-
Then the local DNS asks the tutorialspoint.com DNS server the same question.
-
Then tutorialspoint.com DNS server replies with IP address of www.tutorialspoint.com.
-
Now, the local DNS sends the IP address of www.tutorialspoint.com to the computer that sends the request.