TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why did hostnames get reversed?

7 点作者 sobering大约 12 年前
I did some Googling and apparently my Google-fu is weak today.<p>I'm wondering why hostnames ended up being reversed. Ex: .com.example is now example.com.<p>I recall reading that the reversal happened somewhere during the development of a messaging protocol for ARPANET. com.example@user was reversed to user@example.com and then it just sort of stuck. Am I far off?<p>Does anyone have any resources or anecdotes that explain this at all? I think I may have even seen this explained in an HN thread once but was unsuccessful in finding it.<p>Thanks.

2 条评论

drostie大约 12 年前
The earliest RFC which I know of which spells it out is RFC 805, <a href="https://tools.ietf.org/html/rfc805" rel="nofollow">https://tools.ietf.org/html/rfc805</a><p><pre><code> It was clear that the information content of all these syntactic alternatives was the same, so that the one causing least difficulty for existing systems should be chosen. Hence it was decided to add all new information on the right of the @ sign, leaving the "user" field to the left completely to each system to determine (in particular to avoid the problem that some systems already use dot (.) internally as part of user names). The conclusion in this area was that the current "user@host" mailbox identifier should be extended to "user@host.domain" where "domain" could be a hierarchy of domains. In particular, the "host" field would become a "location" field and the structure would read (left to right) from the most specific to the most general. </code></pre> It was chosen apparently because RFC 805 was standardizing to "mailbox@computer", and since 'mailbox' is more specific than 'computer' it became more and more specialized going left.<p>As for why 'mailbox' comes first, it's presumably because that's someone's username. The very first thing you want to see is, "I'm sending this to drostie," and only afterwards do you need to know where that server is located.
评论 #5764915 未加载
chiph大约 12 年前
I don't have any concrete evidence, but my guess is that having the repeating value (the TLD) at the front meant that storing domain names in a hashtable was inefficient. Lookups would be faster if the more-unique part was at the front of the string, since the string comparisons would run faster.
评论 #5765103 未加载