简体   繁体   English

不带 http://www 的域名的最大长度。 & .com 零件

[英]Maximum length of a domain name without the http://www. & .com parts

What is the maximum length of the 'name' part in a domain?域中“名称”部分的最大长度是多少? I'm referring to the google in http://www.google.com .我指的是http://www.google.comgoogle How long can the google part be without what's before and after it? google部分可以在没有之前和之后的内容的情况下持续多久?

每个标签最多可包含 63 个字符。

"URI producers should use names that conform to the DNS syntax, even when use of DNS is not immediately apparent, and should limit these names to no more than 255 characters in length." “URI 生产者应该使用符合 DNS 语法的名称,即使 DNS 的使用不是很明显,并且应该将这些名称的长度限制为不超过 255 个字符。”

http://tools.ietf.org/html/rfc3986 http://tools.ietf.org/html/rfc3986

"The DNS itself places only one restriction on the particular labels that can be used to identify resource records. That one restriction relates to the length of the label and the full name. The length of any one label is limited to between 1 and 63 octets. A full domain name is limited to 255 octets (including the separators)." “DNS 本身仅对可用于识别资源记录的特定标签施加了一项限制。这一限制涉及标签的长度和全名。任何一个标签的长度都限制在 1 到 63 个八位字节之间. 完整域名限制为 255 个八位字节(包括分隔符)。”

http://tools.ietf.org/html/rfc2181 http://tools.ietf.org/html/rfc2181

The full domain name may not exceed a total length of 253 characters in its external dotted-label specification.完整域名在其外部点标签规范中的总长度不得超过 253 个字符。

http://en.wikipedia.org/wiki/Domain_Name_System http://en.wikipedia.org/wiki/Domain_Name_System

If you are getting anywhere close to 253 characters, I think you should look for a shorter domain name...如果您接近 253 个字符,我认为您应该寻找更短的域名...

作为演示,本网站有一个 63 个字符的域名,最大允许: http : //63-characters-is-the-longest-possible-domain-name-for-a-website.com

TLDR Answer TLDR 答案

Use these limits:使用这些限制:

Labels: 61 octets.标签: 61个八位字节。

Names: 253 octets.名称: 253个八位字节。

Many applications will work even if you exceed these limits (like Gmail), but there are many older applications that will not.即使您超出了这些限制(如 Gmail),许多应用程序仍能正常工作,但有许多较旧的应用程序则不能。

Source来源

RFC1035: Domain Names - Implementation And Specification (published November 1987), an accepted Internet Standard , gives the following limits to subdomains and to the entire domain length when viewed in a browser... RFC1035:域名 - 实施和规范(1987 年 11 月发布),一种公认的Internet 标准,在浏览器中查看时,对子域和整个域长度给出了以下限制...

Various objects and parameters in the DNS have size limits. DNS 中的各种对象和参数都有大小限制。 They are listed below.它们在下面列出。 Some could be easily changed, others are more fundamental.有些可以很容易地改变,有些则更基本。

labels 63 octets [bytes/characters] or less标签63个八位字节 [字节/字符] 或更少

names 255 octets [bytes/characters] or less名称255个八位字节 [字节/字符] 或更少

The working level of these are:它们的工作级别是:

  • Labels: 61 octets.标签: 61个八位字节。
  • Names: 253 octets.名称: 253个八位字节。

That's because RFC821 (published August 1982) defines emails in the format of user@domain.com , and the smallest value for user would be one character.这是因为RFC821 (1982 年 8 月发布)以user@domain.com格式定义电子邮件,并且user的最小值将为一个字符。 That leaves one character for @ , and then you only have 253 characters left for the domain.com part.这为@留下了一个字符,然后domain.com部分只剩下253字符。

This was reconfirmed numerous times...这被无数次再次确认......

  • RFC2181: Clarifications to the DNS Specification (published July 1997) : Only a proposed standard. RFC2181: Clarifications to the DNS Specification (1997 年 7 月发布):只是一个提议的标准。 "A full domain name is limited to 255 octets (including the separators)." “完整的域名限制为 255 个八位字节(包括分隔符)。”

  • RFC3986: Uniform Resource Identifier (URI): Generic Syntax (published January 2005) : Accepted Internet standard. RFC3986:统一资源标识符 (URI):通用语法(2005 年 1 月发布):接受的 Internet 标准。 "URI producers should use names that conform to the DNS syntax, even when use of DNS is not immediately apparent, and should limit these names to no more than 255 characters in length." “URI 生产者应该使用符合 DNS 语法的名称,即使 DNS 的使用不是很明显,并且应该将这些名称的长度限制为不超过 255 个字符。”

  • RFC5321: Simple Mail Transfer Protocol (published October 2008) : Only a proposed standard. RFC5321:简单邮件传输协议(2008 年 10 月发布):只是一个提议的标准。 This RFC gives the max length of label or subdomains to be 64 , one more than the others of 63 .该 RFC 规定标签或子域的最大长度为64 ,比其他63 I recommend sticking with 63 .我建议坚持使用63 "The maximum total length of a domain name or number is 255 octets." “域名或号码的最大总长度为 255 个八位字节。”

You may have 63 characters per label (or subdomain) and 255 characters per name (this includes the TLD).每个标签(或子域)可以有 63 个字符,每个名称可以有 255 个字符(包括 TLD)。

Notice that it gives the definition in octets .请注意,它以octets给出了定义。 That's because it's looking at physical bytes, not literal bytes.那是因为它正在查看物理字节,而不是文字字节。 For instance, \\.例如, \\. is interpreted as .被解释为. (one literal byte), because the \\ escapes it, but it is encoded as \\. (一个文字字节),因为\\转义,但它被编码为\\. (two physical bytes). (两个物理字节)。 These octet limits are physical byte limits.这些八位字节限制是物理字节限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找到http://和/或www。 并从域中剥离。 离开domain.com - Find http:// and or www. and strip from domain. leaving domain.com 验证网址而不使用www。 或http:// - validate url without www. or http:// 需要一个匹配带/不带 http:// 或 www 的 URL 的正则表达式。 或 http://www. 在文本中 - Need a regex that matches URLs with/without http:// or www. or http://www. in a text 如何仅从 URL 字符串中提取网站名称而不是 www。 和 .com - How to Extract only the website name from a URL String not www. and .com with it 如何在IIS 8中编写重写规则,以便所有流量都从http://*.com指向https://www.*.com? - How do can I code a rewrite rule in IIS 8 so that all traffic points to https://www.*.com from http://*.com? Uri.TryCreate错误上的“ http:// www。”? - “http://www.” on Uri.TryCreate bug? .htaccess文件没有重定向http:// www。 到https:// www - .htaccess file not redirecting http://www. to https://www “ / page”和“ http://www.domain.com/page”之间的区别 - difference between “/page” and “http://www.domain.com/page” 为什么是http:// www。 转到/index.php和https:// www。 才不是? - Why http://www. goes to /index.php and https://www. does not? 浏览器添加www。 和.com自动服务器地址 - Browsers adding www. and .com to server address automatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM