DNS二级域名查找

发布于 2024-12-25 17:41:19 字数 490 浏览 0 评论 0原文

DNS二级域名查找是如何工作的?例如,在 URL web.example.com 中,顶级域是 .com,二级域是 .example。根据我的理解,当我们找到一个顶级域的服务器后,如果这个顶级服务器实际上没有二级域的记录,我们就去查询另一个顶级服务器。 DNS 如何决定查询下一个顶级域名服务器?世界上有很多顶级域名服务器吗(因为有很多二级域名可用)?由于二级名称如此之多,这个过程可能需要多长时间?

维基百科对此进行了描述:http://en.wikipedia.org/wiki/Domain_Name_System#Address_resolution_mechanism,但是本节并没有解释如何通过二级域名信息高效地找到顶级服务器。

我的问题的重点是DNS如何有效地搜索数百万/数十亿的二级域名。

How does DNS second-level domain lookup work? For example, in a url web.example.com, the top-level domain is .com, and the second level domain is .example. Based on my understanding, after we find a server for the top-level domain, if this top-level server does not actually have a record for the second-level domain, we query a different top-level server. How does DNS decide which next top-level domain server to query? Are there a lot of top-level domain servers in the world (since there are so many second-level names available)? Since there are so many second-level names, how long could this process potentially take?

This is described on wikipedia: http://en.wikipedia.org/wiki/Domain_Name_System#Address_resolution_mechanism, but this section does not explain how to efficiently find the top-level server with the second-level domain info.

The point of my question is how does DNS efficiently search millions/billions of second-level domains.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白云不回头 2025-01-01 17:41:19

DNS 第二(以及第三、第四)级域查找的工作方式与第一级域查找的工作方式完全相同。

您在问题中提出的描述是错误的。例如,“如果这个顶级服务器实际上没有二级域名的记录,我们就查询不同的顶级服务器”是错误的。如果某个域的其中一台服务器没有下一级子域的记录,则搜索结束:该子域不存在。

DNS 解析如何工作的完整描述超出了 SO 答案的范围,但简而言之:

从根服务器开始,每个 DNS 服务器要么给出问题的答案,要么引用另一台服务器。假设查询 web.example.com,根服务器将为您推荐 com. 的 gTLD 服务器。然后您将去查询其中一台服务器。它将为您推荐 example.com 的名称服务器。您现在将去查询其中一台服务器。它可能会给你一个答案(要么是像 NXDOMAIN 这样的错误(没有这样的域),要么是一些记录)。如果子域 web.example.com 已进一步委托给其他一些服务器,它还可以为您提供推荐...

DNS second- (and third-, and fourth-) level domain lookup works exactly the same way first-level domain lookup works.

The description you present in the question is wrong. For example, "if this top-level server does not actually have a record for the second-level domain, we query a different top-level server" is wrong. If one of the servers for a domain does not have a record for a subdomain one level down, that's the end of the search: the subdomain does not exist.

A full description of how DNS resolution works is outside the scope of a SO answer, but in a nutshell:

Starting from the root servers, each DNS server either gives an answer to the question or a referral to another server. Assuming a query for web.example.com, the root servers will give you a referral to the gTLD servers for com.. You will then go query one of those servers. It will give you a referral to the nameservers for example.com. You will now go query one of those servers. It will probably give you an answer (either an error like NXDOMAIN (no such domain) or some records). It could also give you a referral if the subdomain web.example.com has been further delegated to some other servers...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文