大网数据广告活动
网站运营与故障问答

Is using two TLDs okay? (FQDN - DNS Hierarchy (gTLD + ccTLD) websites)

· 52CE 我爱测

I have seen so many websites with two TLDs, like this one below: example.com.ph (not real FQDN, by the way) I am confused on whether what is the actual TLD server that the root server is redirecting me, in theory. Like, is .ph th…

问题原文

原帖链接 · Joshua Dela Cruz · CC BY-SA 4.0

I have seen so many websites with two TLDs, like this one below:

example.com.ph (not real FQDN, by the way)

I am confused on whether what is the actual TLD server that the root server is redirecting me, in theory.

Like, is .ph the TLD or .com or both .com.ph?

If it's .ph, then SLD is the .com?

If .com is the TLD, then what is the .ph for?

I would understand better if the .com.ph is the TLD, but what should I call it? Combined TLD?

已采纳解答

原帖链接 · Patrick Mevzek · CC BY-SA 4.0

The DNS is a tree, inverted if you want.

It starts with the root, aka ., typically written on top.

Then just below you have TOP level domains, aka TLDs. You can find the list of them at https://www.iana.org/domains/root/db

Do note they change, albeit slowly. There can be changes in countries, but most often they are changes in gTLDs, following ICANN 2012 round of new TLDs and supposedly some future new rounds.

ccTLDs are delegated to government. For your example: https://www.iana.org/domains/root/db/ph.html showing the Philippines owning it.

Each ccTLD (country) decides then how they handle their TLD, if it is flat, or if it is again subdivided. In history, some started subdivided (ex: uk had co.uk, me.uk, etc.) and then opened directly below TLD (you can now register directly under uk).

So in your example, in precise naming, ph is the TLD. com.ph is an 2LD or Second Level Domain.

It may be seen sometimes people will say com.ph is the TLD because they are thinking about the registration plane, not the resolution plane. The resolution plane is the DNS and the structure explained above: TLDs are single labels below root, then everything below is "Second Top" level (SLD or 2LD), then third and so on (you can look at us TLD for examples of names being 4th, 5th or even 6th levels below root). But, the registry of ph for example may have decided that you can only buy domains below com.ph not directly below ph. That is totally their right. As such some people will consider it is useless to speak about ph directly, because you can't "do" anything below it, you can only act below com.ph.

So it happens that TLD will often be used (misused) for labels that are technically not first level below root. Coming from the web, because of cookies, you can find sometimes also "eTLD" for "effective TLD", like "it is not technically a TLD because not one label below root, but act as one in the sense people register domains below it".

But the real proper term should be "public suffix". It means "anything" (TLD or not) that does exist in the public DNS, and is a valid suffix, that is a point (anchor) below which you can register names.

Also remember that registration can happen at multiple levels at the same time. Verisign handles .com TLD and you can register below it, but then Centralnic bought uk.com (from Verisign) and Centralnic acts as a registry so you can buy domains under uk.com "TLD". As such, both com and uk.com are valid public suffixes.

But going back to your example in com.ph, there com IS NOT a TLD. And any domain never has 2 TLDs, there is only one, technically the first label when starting from the right.

Terminology wise, the WHATWG Community (browsers basically) enacted those terms to be stricter at https://url.spec.whatwg.org/:

  • A host’s public suffix is the portion of a host which is included on the Public Suffix List.
  • A host’s registrable domain is a domain formed by the most specific public suffix, along with the domain label immediately preceding it, if any.

See also this RFC on DNS terminology if you want to be sure to exact proper technical terms in all cases: https://www.rfc-editor.org/rfc/rfc8499 but it is mostly dealing with the resolution plane, not the registration one. See its definition of TLD:

Top-Level Domain (TLD): A Top-Level Domain is a zone that is one layer below the root, such as "com" or "jp". There is nothing special, from the point of view of the DNS, about TLDs. Most of them are also delegation-centric zones (defined in Section 7), and there are significant policy issues around their operation. TLDs are often divided into sub-groups such as Country Code Top-Level Domains (ccTLDs), Generic Top-Level Domains (gTLDs), and others; the division is a matter of policy and beyond the scope of this document.

You can also view current list of public suffixes at https://publicsuffix.org/ ; do remember this is a manually curated list, which obviously includes all TLDs, but much more because of what we discussed above.

PS: the root servers are not "redirecting" you, there is no concept of "redirection" in DNS world, this was invented 15 years after DNS was invented, when HTTP was created.

You can ask root servers about ph and they reply it is delegated to:

$ dig +noall +auth ph @a.root-servers.net NS
ph.         2d IN NS ns4.apnic.net.
ph.         2d IN NS ns2.cuhk.edu.hk.
ph.         2d IN NS 1.ns.ph.
ph.         2d IN NS ph.communitydns.net.

You can then ask any of these nameservers about where com.ph is delegated, if it is (a "dot" in a name does not technically imply always a delegation; for example gouv.fr right now is not technically delegated out of fr even if it works perfectly):

$ dig +noall +auth com.ph @ns4.apnic.net. NS
ph.         15m IN SOA ph-tld-ns.dot.ph. sysadmin.domains.ph. (
                2023010421 ; serial
                21600      ; refresh (6 hours)
                3600       ; retry (1 hour)
                2592000    ; expire (4 weeks 2 days)
                86400      ; minimum (1 day)
                )

So by this reply you can see, com.ph not being technically delegated from ph, which means it is handled by the same nameservers and hence the same organization (you would get the opposite result if trying with com and uk.com because as explained above they are handled by different organizations).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2023-01-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。