主机名和URL语法 [英] Host names and URL syntax

查看:213
本文介绍了主机名和URL语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经对正确的主机名语法进行了一些阅读,并且无法弄清楚什么是非常合适的主机名/ URL语法
您能告诉我以下URL在语法上是否正确吗?

I have done some reading on proper Hostname syntax and can't figure out what is a really proper Hostname/URL syntax Can you please tell me if the following URLs are syntactically correct?

1.2.3.4.5.6.7 / something

10.123.143.13333 / something

1.2 .3.4.5.6.7.com / something

some.host.name.com.org/something

这些只是我无法弄清楚的一些例子。
这些网址是否正确?

Those are just some examples that i couldn't figure out. Are those URLs correct?

推荐答案

这些不是网址,因为它们缺少方案

These are not URLs, as they are missing a scheme.

假设您的意思是HTTP网址,它们将是:

Assuming that you mean HTTP URLs, they would be:

http://1.2.3.4.5.6.7/something
http://10.123.143.13333/something
http://1.2.3.4.5.6.7.com/something
http://some.host.name.com.org/something

RFC 3986定义主机子组件(HTTP(S)URI的RFC 2616如下)。

RFC 3986 defines the syntax of the host subcomponent for all URIs (and RFC 2616 for HTTP(S) URIs follows that).

主机您的示例URI的名称将是:

The host names of your example URIs would be:

1.2.3.4.5.6.7
10.123.143.13333
1.2.3.4.5.6.7.com
some.host.name.com.org

有效主机名遵循 IP-literal IPv定义的语法(在上面链接的部分中) 4address ,或 reg-name

Valid host names follow the syntax defined (in the section linked above) by IP-literal, IPv4address, or reg-name:


  1. 检查 IP-literal

作为 IP-literal 要求用方括号括起来( [ ... ] ),没有 IP-文字主机名。

As an IP-literal requires enclosing square brackets ([]), none are IP-literal host names.

检查 IPv4地址

作为 IPv4地址必须包含三个个字符, 1.2.3.4.5.6.7 1.2.3.4.5.6.7.com ,以及部分。 host.name.com.org 不能是 IPv4address 主机名。

As an IPv4address must contain exactly three . characters, 1.2.3.4.5.6.7, 1.2.3.4.5.6.7.com, and some.host.name.com.org can’t be IPv4address host names.

虽然 10.123.143.13333 有三个, 13333不是有效的 dec-octet ,所以它不是 IPv4地址

While 10.123.143.13333 has three ., "13333" is not a valid dec-octet, so it’s not an IPv4address.

检查 reg-name

您的所有示例均有效 reg-name 主机名,如 0-9 az 是允许的字符。

All of your examples are valid reg-name host names, as 0-9, a-z, and . are allowed characters.

请注意,意味着这些是DNS中的有效域名。 RFC 3986并未强制要求使用特定的注册名称查找技术。

Note that this does not mean that these are valid domain names in the DNS. RFC 3986 "does not mandate a particular registered name lookup technology".

这篇关于主机名和URL语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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