强制将域名中的字母大写 [英] Force capitalize letters in domain name

查看:127
本文介绍了强制将域名中的字母大写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我了解域名不区分大小写的事实:

So I understand the fact that domain names are case insensitive:

google.com, GOOGLE.COM, GooGLe.Com, gOOgle.cOm ===> google.com

但我的问题是:是否可以在域名中强制使用字母是否显示为默认大写字母?

例如,如果我拥有www.crazycapitalization.com,则可以通过任何方式使它显示为CrazyCapitaliZation.com。

For example, if I owned www.crazycapitalization.com is there any way I could make it appear as CrazyCapitaliZation.com by default whenever the domain was accessed?

crazycapitalization.com, CRAZYCAPITALIZATION.COM ===> CrazyCapitaliZation.com

如果无法做到这一点,我很想知道为什么。

If this cannot be done I would be curious to know why.

谢谢!

推荐答案

查找的地方是 域名规范(RFC 2035)

The place to look this up is the Domain Names specification (RFC 2035).

它指出, 在域名中允许使用大写和小写字母,但大小写没有任何意义。也就是说,两个具有相同拼写但大小写不同的名称应被视为相同。 这就是您确实注意到的。

It states that "while upper and lower case letters are allowed in domain names, no significance is attached to the case. That is, two names with the same spelling but different case are to be treated as if identical." That's what you noted indeed.

有趣的是(也许令许多人惊讶的是,它还说当数据进入域系统时,应尽可能保留其原始情况 将来可能需要超出当前使用量的
添加在名称中使用完整的二进制八位位组功能,因此应避免尝试以7位ASCII存储域名或使用特殊字节来终止标签等。

Interestingly (and perhaps surprisingly to many), it also says that "when data enters the domain system, its original case should be preserved whenever possible" and "future additions beyond current usage may need to use the full binary octet capabilities in names, so attempts to store domain names in 7-bit ASCII or use of special bytes to terminate labels, etc., should be avoided."

因此,在原始设计中,有可能保留大小写(即使比较总是以不区分大小写的方式进行)。但是,当解析域名时,您的浏览器仅询问属于该域的IP地址(而不询问规范名称)。因此,即使某个DNS服务器可以存储大小写(据我所知通常不存储),您的浏览器也不会使用该信息。

So in the original design, there was a possibility to preserve the case (even though comparison always happens in a case-insensitive way). However, when it resolves a domain name, your browser only asks the IP address belonging to that domain (and not the "canonical" name). So even if a certain DNS server would store case (usually not, as far as I know), your browser wouldn't use that information.

可以完成,但只能使用特制的浏览器(可能是DNS服务器)。


最酷的事情是:您仍然会尊重DNS协议。

So it could be done, but only with a specifically crafted browser (and perhaps DNS server).
The cool thing is: you would still be respecting the DNS protocol.

这篇关于强制将域名中的字母大写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆