域名后缀的通用列表?
有谁知道我在哪里可以找到所有公开可用的域名后缀的列表?我所说的“域名后缀”不一定是指 TLD,因为我对 .co.uk 的 .uk 部分不感兴趣,因为(据我所知)个人无法在前面没有 .co 的情况下注册网站。
如果它有助于使事情变得更具体,这是我的具体问题:给定一个域名,我想返回以 www 开头的域版本和不以 www 开头的版本。输入域可能包含也可能不包含 www。
复杂性来自于“www.com”或“www.info”等域名的存在;我最初实现的是 www.info 并返回 info 和 www.info。
Does anyone know where I could find a list of all publicly available domain endings? By "domain endings", I'm not necessarily referring to TLDs as I'm not interested in the .uk part of .co.uk since (AFAIK) individuals cannot register sites without having the .co preceding it.
If it helps to make things more concrete, here's my specific problem: given a domain name I want to return both the version of the domain preceded by www and the version not preceded by www. The input domain may or may not contain www.
The complication comes from the existence of domain names such as "www.com" or "www.info"; what I initially implemented would take www.info and return info and www.info.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您实际上不需要拥有域名列表:
伪代码:
I don't think you actually need to have a list of domain names:
Pseudocode:
您可以通过多种方式获取当前 TLD 列表,但略有不同。
例如:
当然,这只会为您提供“顶级域名”,而不是注册表允许的所有“后缀”公众(总体或部分公众)注册域名。
如果考虑到自动化流程、新鲜度、更新分散化等需求,拥有这些列表目前仍然是一个未解决的问题。
最好的解决方案是使用公共后缀列表 https://publicsuffix.org/list/public_suffix_list.dat 但首先确保去到主网站 https://publicsuffix.org/learn/ 详细了解它是什么,如何使用它以及它的缺点。
您会在那里找到
co.uk
。但至于你的:
现在情况已不再如此,这表明顶级域名 (TLD) 的资格要求甚至结构会随着时间的推移而发生变化。
.UK
现已开放直接注册,请参阅 https://www.nominet.uk/domains/our-domains/uk-domains/另外,顺便说一句,当您使用域名/TLD 时,请不要忘记 IDN,这可能发生在任何地方标签在域名系统。
You can get the list of current TLDs in many ways, slightly differently.
For example:
AXFR
requests to just download the current root zonefile, such asdig @f.root-servers.net . AXFR
with the added benefit that this is protected by DNSSEC (where the previous HTTP URL has no protection against tampering)Of course this gives you only "Top Level Domains" not all "suffixes" under which a registry exists to allow the public (in general or part of it) to register domain names.
Having the list of those is currently still an unsolved problems, if you take into account the needs of automated process, freshness, decentralization of updates, etc.
The best solution is to use the Public Suffix List at https://publicsuffix.org/list/public_suffix_list.dat but first make sure to go to main site at https://publicsuffix.org/learn/ to learn in details about what it is, how to use it and its shortcomings.
You will find
co.uk
there.But as for your:
This is not true anymore, showing that eligibility requirements in TLDs, or even structure, change over time.
.UK
is open to direct registrations now, see https://www.nominet.uk/domains/our-domains/uk-domains/And also, side rant, when you work with domain names/TLDs please do not forget about IDNs, that could happen in any label in the DNS.