Short answer
A top-level domain is the zone one step below the DNS root, and a subdomain is any domain contained inside another domain. ICANN's example is icann.org, where org is the TLD and icann.org is a subdomain of .org. RFC 9499 tests a subdomain by checking whether its name ends with the containing name, on whole labels. Neither document makes one label a website by itself.
Last verified against the sources listed below.
Key takeaways
- A TLD is one layer below the root. RFC 9499's examples are com and jp.
- ICANN says the TLD is the part after the second-level domain, as org is in icann.org.
- A name is a subdomain when it ends with the parent name, compared on whole labels.
- In shop.example.com, com is the TLD and shop.example.com is a subdomain of example.com.
- A label is 0 to 63 octets. A global DNS name is at most 255 octets on the wire.
- example.com is an IANA documentation name. It is not available to register.
The comparison in top level domain vs subdomain is about two labels inside one name, not about two kinds of website. The rightmost label under the root is the top-level domain. A subdomain is any domain name contained in a longer one.
IANA keeps example.com, and example.org, for illustrations like this one. Those names are not available to register or transfer. The walkthrough below uses shop.example.com for that reason.
Which label is the top-level domain?
The top-level domain is the zone one layer below the DNS root.
RFC 9499 says there is nothing special, from the DNS point of view, about that layer. Its examples are com and jp. Policy, not the protocol, sorts them into groups such as country-code TLDs and generic TLDs. The RFC leaves that sorting out of scope.
ICANN’s glossary uses a written name instead of a tree. In icann.org, org is the TLD, the part after the second-level domain. TLD administrators decide which second-level names are recognized. ICANN sorts TLDs into generic names, such as .com, .net, and .edu, and country-code names, such as .jp, .de, and .in.
The New gTLD glossary says the TLD is the string after the last dot, such as NET in www.example.net. The root zone’s administrators decide which TLDs exist. A second-level name is a name registered in a TLD. In icann.org, ICANN is the second-level label.
Which name is the subdomain?
A subdomain is a domain contained in another domain, tested by the ending of the name.
ICANN’s subdomain entry gives the pairs. community.icann.org and gnso.icann.org are subdomains of icann.org, and icann.org is a subdomain of .org. Registrars delegate second-level names to registrants, who can then delegate further names inside what they hold.
RFC 9499 quotes RFC 1034 for the test: a domain is a subdomain of another if it is contained in that domain, which you check by seeing whether the subdomain’s name ends with the containing name. In nnn.mmm.example.com, both mmm.example.com and the full name are subdomains of example.com. The compare is on whole labels. ooo.example.com is not a subdomain of oo.example.com.
That test is wider than everyday speech. People often say “the subdomain” and mean only the leftmost label. The RFC’s test also makes example.com a subdomain of com.
How do you read shop.example.com?
Read it from the right: com is the TLD, example is the second-level label, and shop.example.com is a subdomain of example.com.
| Piece of shop.example.com | What the opened docs call it |
|---|---|
| com | TLD, one layer below the root, like RFC 9499’s com |
| example | Second-level label, the name registered in that TLD |
| example.com | A subdomain of .com, by the icann.org-of-.org pattern |
| shop | Leftmost label. Some people call only this the hostname |
| shop.example.com | A subdomain of example.com, because the name ends with it |
| shop.example.com. | Presentation form of the FQDN, with the root dot |
A domain name, in RFC 9499, is an ordered list of one or more labels. A label is an ordered list of octets. In the global DNS each label is 0 to 63 octets, and only the root label may be empty, and it is last.
The whole name is at most 255 octets in wire format, and the root counts as one octet.
Common display usually drops that root dot. Presentation format keeps it, so a fully qualified name with a root looks like example.tld. with a final dot. The dot you type between shop, example, and com is the separator, not a label.
Host name is the loose word. RFC 9499 says the classic DNS RFCs do not define it. People sometimes mean a name whose labels are letters, digits, and hyphens, and they sometimes mean only the first label, the printer in printer.admin.example.com.
On that second habit, shop is the hostname and com is still the TLD. The words are not interchangeable.
Where does hosting enter?
Hosting is the computer that stores the site. The labels only name a place in the DNS tree.
A top-level domain is the registry layer ICANN describes. It does not include the pages, the files, or the application. Delegation says who may add names under a zone. It does not say which disk those names use.
Web hosting is the separate question: where the files live and which server answers. shop.example.com and example.com can share a host or use two hosts. The glossary does not pick a winner. IANA also says the web service on example domains is best effort and should not be built into a production app.
Images on that host are files, not labels. An image compressor changes the file size. It does not change which label is the TLD.
Why do the two labels get confused?
They get confused because both words appear in one written name, and everyday speech uses subdomain for a single label.
Say the full name shop.example.com out loud and you can point at three labels. Only com is the TLD. shop.example.com as a whole is a subdomain of example.com, and example.com as a whole is a subdomain of com.
Calling shop “the subdomain” is a shorthand. It matches the first-label habit in the hostname paragraph. It does not match the RFC 1034 test, which looks at the ending of the whole name.
The New gTLD glossary’s “string after the last dot” rule keeps the TLD easy to spot. Everything to the left can be one label or many. Adding shop does not create a new TLD. It creates a longer name inside the name you already had.
If a form asks for the domain and the subdomain as two boxes, check which test that form uses. A DNS test wants the parent name and the contained name. A marketing form often wants only the leftmost label. The opened RFCs and glossaries support the first test.
Frequently asked questions
What is subdomain vs top level domain?
A top-level domain is the label one step under the DNS root, such as com or jp. A subdomain is a domain contained in a higher domain. ICANN says community.icann.org is a subdomain of icann.org, and icann.org is a subdomain of .org. RFC 9499, quoting RFC 1034, tests that by checking whether the longer name ends with the shorter one, using whole labels. The two words name different spans of the same name. They are not two competing products.
Is example.com a subdomain of com?
Yes, by ICANN's own pattern. The glossary says icann.org is a subdomain of the top-level domain .org, so example.com is a subdomain of .com in the same way. RFC 9499 also says a TLD is a zone one layer below the root, and that nothing in the DNS protocol makes a TLD special. IANA keeps example.com for documentation. You can use it in an explanation. You cannot register it or transfer it.
Does shop count as a hostname?
Sometimes people use hostname for only the first label. RFC 9499 says that happens with printer in printer.admin.example.com. On that habit, shop is the first label of shop.example.com. The same paragraph says the DNS documents it cites do not actually define hostname. A stricter reading is the preferred name syntax: letters, digits, and hyphens, with digits allowed at the start because of RFC 1123. Shop fits that syntax. The word hostname is still the loose one.
What is the 63 octet rule?
RFC 9499 says each label in the global DNS is between 0 and 63 octets, inclusive. Only the root label may be 0 octets long, and it comes last in a fully qualified name. The whole name is at most 255 octets in wire format, and the root counts as one of those octets. Presentation format puts a dot between labels. Common display usually drops the final root dot, so people write shop.example.com rather than shop.example.com. with a trailing dot.
Does the TLD decide the host?
No. ICANN says the TLD administrator controls which second-level domains are recognized in that TLD. The registrant can then delegate subdomains inside the name they hold. Delegation chooses who answers for a zone. It does not choose the computer, the disk, or the files. Those belong to hosting. A shop label can point at the same host as the parent name, or at a different one, depending on DNS records the glossary does not list.
Sources
- Top-level domain · ICANN, 2026
- Subdomain · ICANN, 2026
- Glossary, New gTLD Applicant Guidebook · ICANN, 2026
- RFC 9499, DNS Terminology · IETF, 2026
- Example Domains · IANA, 2026