服务器域名 一级域名_HTTP简介:域名系统服务器

服务器域名 一级域名

by Cher Don

由谢尔·唐(Cher Don)

HTTP简介:域名系统服务器 (An introduction to HTTP: Domain Name System servers)

DNS如何工作,为什么重要? (How does the DNS work, and why is it important?)

总览 (Overview)

Throughout this series, we will be tackling the basics such as:

在整个系列中,我们将处理以下基本知识:

  • How does DNS work? [You are here!]

    DNS如何工作? [你在这里!]

  • Network Stack, OSI Model

    网络堆栈,OSI模型

  • HTTP Methods and Formats

    HTTP方法和格式
  • Client Identification

    客户识别
  • Basic/Digest Authentication

    基本/摘要身份验证
  • HTTPS working with SSL/TLS

    HTTPS与SSL / TLS一起使用

什么是HTTP? (What is HTTP?)

HyperText Transfer Protocol (HTTP) is a protocol devised by Sir Tim Berners Lee in 1989. It forms the basis for how web pages communicate from the web server to the client’s browser.

超文本传输​​协议(HTTP)是Tim Berners Lee爵士在1989年设计的协议。它构成了网页如何从Web服务器通信到客户端浏览器的基础。

DNS服务器 (DNS Servers)

Is the connection to the webpage established immediately after typing in the Domain Name, such as medium.com? Definitely not!

输入域名(例如medium.com后,是否立即建立了与网页的连接? 当然不!

Machines, unlike us, recognize the location of webpages by IP Addresses. These string of numbers, such as 104.16.121.127, are more machine friendly especially since there are millions of domain names on the Web.

与我们不同,机器通过IP Addresses识别网页的位置。 这些数字字符串(例如104.16.121.127 )对计算机更友好,尤其是因为Web上有数百万个域名。

The Domain Name System (DNS) plays a crucial role in the whole HTTP request process, as it allows us to call a webpage by typing a simple domain name, www.medium.com instead of 104.16.121.127 every time you want to access the site.

域名系统(DNS)在整个HTTP请求过程中起着至关重要的作用,因为它使我们每次想访问该域名时都可以通过键入一个简单的域名www.medium.com而不是104.16.121.127来调用网页。现场。

Without DNS, your brain would be filled with numbers just trying to remember the IP Addresses for every single website you use!

如果没有DNS,你的大脑会被写满数字只是想记住的IP地址使用一个网站!

Now that we know that an IP Address is requested every time we type in the domain name, let’s find out where this request searches for the correct IP Address.

既然我们知道每次输入域名都需要一个IP地址,那么让我们找出该请求在哪里搜索正确的IP地址。

本地缓存 (Local Cache)

A cache is a block of memory for temporary storage of data that has a high probability of being used again. The first thing that happens is the DNS Resolver (residing in your computer) will check the browser’s cache, followed by the computer’s DNS cache. If you accessed the website recently, it would have the IP address cached in the system.

高速缓存是用于临时存储数据的内存块,该数据很有可能再次被使用。 发生的第一件事是DNS解析器(位于您的计算机中)将检查浏览器的缓存,然后是计算机的DNS缓存。 如果您最近访问过该网站,则该IP地址将被缓存在系统中。

In that case, the browser can immediately call the IP Address to retrieve the webpage!

在这种情况下,浏览器可以立即调用IP地址来检索网页!

One thing to note here is that every cache has an expiry date, called the “Time to Live” setting. This setting determines how long the cache may be stored when the website is accessed. We will address how that works later on.

这里要注意的一件事是,每个缓存都有一个有效期,称为“生存时间”设置。 这个设定 确定访问网站时缓存可以存储多长时间。 稍后我们将解决其工作方式。

DNS递归 (DNS Recursor)

If the IP Address can’t be found in the local cache, it will then request from the DNS Recursor. The DNS Recursor is often the DNS Server of your Internet Service Provider (ISP).

如果在本地缓存中找不到IP地址,它将向DNS递归请求。 DNS Recursor通常是Internet服务提供商(ISP)的DNS服务器。

These Internal DNS Servers have caches from websites that their clients have visited recently. Again, if the IP Address can’t be found here, it will be passed on to the next Domain Server.

这些内部DNS服务器具有来自其客户端最近访问过的网站的缓存。 同样,如果在此找不到IP地址,它将被传递到下一个域服务器。

根级域服务器 (Root-Level Domain Server)

The Root-Level Domain Server (RLDS), or sometimes called the ‘ . ’ Name Server, is simply a gatekeeper for requests. It reads the request and locates the appropriate domain server to redirect to.

根域服务器(RLDS),有时也称为“”。 名称服务器只是请求的网守 。 它读取请求并找到要重定向到的适当的域服务器。

As such, it plays an important role in redirection to the next layer of Domain Servers. They are dispersed all around the world to prevent malicious attacks from bringing down the World Wide Web by targeting the RLDS.

这样,它在重定向到域服务器的下一层时起着重要作用。 它们分散在世界各地,以防止针对RLDS的恶意攻击使万维网瘫痪。

顶级域服务器 (Top-Level Domain Server)

The Top-Level Domain Server (TLDS) is the name server for domains that end with their specific domain suffixes such as .com, .org or .io. After being passed down by RLDS, this layer works in the same way as the second gatekeeper. It takes the requests and runs through its DNS Server to redirect the request to the last and final stop, the Second-Level Domain Server.

顶级域服务器(TLDS)是用于以特定域名后缀(例如.com.org.io结尾的域的名称服务器。 在被RLDS传递后,该层的工作方式与第二个网守相同。 它接收请求并运行其DNS服务器,以将请求重定向到最后一个也是最后一个站点,即第二级域服务器。

The number of domain names are increasing exponentially. It is impossible for the RLDS to be able to store or redirect such a sheer amount of IP Addresses. As such, it is redirected to the TLDS to diversify the processing power and memory required.

域名数量呈指数增长。 RLDS不可能存储或重定向如此大量的IP地址。 因此,它被重定向到TLDS以分散所需的处理能力和内存。

二级域服务器 (Second-Level Domain Server)

This layer is where all the information is stored about the domain is accessible. This DNS Server is usually owned by the institute that is responsible for hosting your website.

在此层可以访问有关该域的所有信息。 此DNS服务器通常由负责托管您的网站的机构所拥有。

As such, a request for the record of the domain is sent to this DNS Server. It returns the IP Address, along with other important information such as the server it is on, and the alias it has.

这样,将域记录的请求发送到此DNS服务器。 它返回IP地址以及其他重要信息,例如其所在的服务器以及其别名。

成功! (Success!)

The browser now receives the IP Address. It uses it to establish a connection with the host server using TCP/IP and retrieve the webpage via HTTP. We will discuss this in Part 2.

现在,浏览器将收到IP地址。 它使用它使用TCP / IP与主机服务器建立连接,并通过HTTP检索网页。 我们将在第2部分中对此进行讨论。

“生存时间”设置 (“Time to Live” Setting)

DNS Records have a Time to Live (TTL) Setting. This determines the amount of time that any of the domain servers can cache the record.

DNS记录具有生存时间(TTL)设置。 这确定了任何域服务器可以缓存记录的时间。

Caching is important. It reduces the loading time for the page, since the DNS information will have to be reacquired every time the domain name is requested. Hence, a high TTL would allow the DNS records to stay alive for a longer period of time. This allow webpages to load faster.

缓存很重要。 它减少了页面的加载时间,因为每次请求域名时都必须重新获取DNS信息。 因此,较高的TTL将使DNS记录可以存活更长的时间。 这样可使网页加载速度更快。

Why don’t all DNS Records have a high TTL then?

那么为什么所有的DNS记录都不具有较高的TTL?

By having a high TTL, it would mean that visitors would not see changes to the DNS immediately. Visitors only see the change after the DNS Record has expired.

TTL高意味着访问者不会立即看到DNS更改。 访问者仅在DNS记录过期后才能看到更改。

For example, if we were to change the host for this webpage, and have a high TTL, the changes would not appear on the visitors browser immediately. This might result in broken links and users not being able to access the webpage.

例如,如果我们要更改此网页的主机,并且TTL高,则更改不会立即显示在访问者浏览器中。 这可能会导致链接断开并且用户无法访问该网页。

主机名-IP地址关系 (Hostname — IP Address Relationship)

So a single domain name is attached to one IP Address?

那么,单个域名会附加到一个IP地址上吗?

The answer is yes… and no. It can be, but doesn’t have to be a one-to-one relationship.

答案是肯定的。 可以是,但不一定是一对一的关系。

单个主机名,多个IP地址 (Single Hostname, Multiple IP Addresses)

A single hostname such as www.google.com can correspond to multiple IP Addresses, to balance the load on the server since there is a significant amount of users calling on the same webpage at any one given point in time.

单个主机名(例如www.google.com可以对应多个IP地址,以平衡服务器上的负载,因为在任何给定的时间点都有大量用户在同一网页上进行呼叫。

DNS Servers use a “Round Robin” method, such that all IP Addresses are equally utilized.

DNS服务器使用“ Round Robin”方法,从而平等地利用所有IP地址。

多个主机名,单个IP地址 (Multiple Hostname, Single IP Address)

The purpose for this might be for referral links. For example, searching amazon.com/products/pc will show the product screen for PCs. Although amazon.com/products/pc?user=cherdon will also show the same webpage, any purchase would tell Amazon that I was the referrer, allowing me to gain commission from it.

这样做的目的可能是引用链接。 例如,搜索amazon.com/products/pc将显示PC的产品屏幕。 尽管amazon.com/products/pc?user=cherdon也将显示相同的网页,但任何购买都会告诉亚马逊我是推荐人,这使我可以从中获得佣金。

Companies often buy multiple domains that link to the same webpage as well. For example, google.com and google.net would link you to the same search engine webpage.

公司通常还会购买链接到同一网页的多个域。 例如, google.comgoogle.net会将您链接到同一搜索引擎网页。

结论 (Conclusion)

The DNS Server is very important as it stores a database for machine-friendly IP Addresses under user-friendly Domain Names. Now that we have learnt how DNS Servers work together in a distributed database, let us explore how the connection with the host server is established with the IP Address in Part 2!

DNS服务器非常重要,因为它在用户友好的域名下存储了机器友好的IP地址的数据库。 既然我们已经了解了DNS服务器如何在分布式数据库中协同工作,那么让我们探索如何在第2部分中使用IP地址建立与主机服务器的连接!

Hi! I’m Cher Don, currently pursuing a Major in Data Science. I’m the CTO of Paralegal Bot, and you can find my website below. Thanks for reading!

嗨! 我是Cher Don ,目前正在攻读数据科学专业。 我是律师助理的首席技术官,您可以在下面找到我的网站。 谢谢阅读!

Piqued;Quality Content We offer the best content for difficult to grasp concepts. We've been there, and felt the same you do…www.piqued.co

激怒 优质内容我们为难以理解的概念提供最佳内容。 我们去过那里,并且感觉和您一样…… www.piqued.co

翻译自: https://www.freecodecamp.org/news/an-introduction-to-http-domain-name-system-servers-b3e7060eca98/

服务器域名 一级域名

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值