gpt4 book ai didi

url - 是否有用于识别 IP 地址和域名的 URI 架构?

转载 作者:行者123 更新时间:2023-12-02 03:40:08 25 4
gpt4 key购买 nike

是否存在允许唯一引用 IP 地址和域名的唯一资源标识符 (URI) 架构?

例如“http://8o.232.240.50”或“http://supersite.com”不是指 IP 地址或域名,而是指一些可以通过 HTTP 协议(protocol)访问的资源,它的 HTTP 路径恰好包括这个给定的IP 地址或域名。因此,它们更像是唯一资源定位符 (URL) 而不是唯一资源标识符 (URI) 或唯一资源名称 (URN)。

我正在寻找的是用于 IP 地址和/或域名的模式,例如“mailto:someemai@something.com”。

类似于“domain:supersite.com”和“ip:80.232.240.50”。

我可以制定这样的方案供我自己使用,但我想知道是否已经有这样的方案了。如果没有,为什么?

最佳答案

RFC 4501: Domain Name System Uniform Resource Identifiers

The Domain Name System (DNS) […] is a widely deployed systemused, among other things, to translate host names into IP addresses.Several protocols use Uniform Resource Identifiers (URIs) to refer todata. By defining a URI scheme for DNS data, the gap between thesetwo worlds is bridged. The DNS URI scheme defined here can be usedto reference any data stored in the DNS.

来自examples :

  • dns:www.example.org.?clAsS=IN;tYpE=A
  • dns:www.example.org
  • dns:simon.example.org?type=CERT
  • dns://192.168.1.1/ftp.example.org?type=A
  • dns:world%20wide%20web.example%5c.domain.org?TYPE=TXT
  • dns://fw.example.org/*.%20%00.example?type=TXT

根据syntax ,应该可以使用带有空 dnsnamednsauthoritydnsauthority 采用在 RFC 3986 中定义的 host ,它说:

host = IP-literal / IPv4address / reg-name

因此应该可以使用域名和 IP 地址(一个空的 dnsname “将被解释为根本身”)。

关于url - 是否有用于识别 IP 地址和域名的 URI 架构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20611000/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com