Anatomy of a Domain: Subdomain, SLD, and TLD
6 min read
## Anatomy of a Domain: Subdomain, SLD, and TLD
A domain name looks simple on the surface — `www.example.com` seems like just a string of words separated by dots. But each segment has a specific name, a specific role in the DNS (Domain Name System) hierarchy, and different rules about who controls it and how it can be changed.
Breaking a domain into its components helps you understand DNS configuration, troubleshoot problems, set up subdomains correctly, and communicate clearly with developers and hosting providers.
## The Full Picture: A Fully Qualified Domain Name
The technical term for a complete, unambiguous domain address is an FQDN (Fully Qualified Domain Name) — Fully Qualified Domain Name. A FQDN (Fully Qualified Domain Name) specifies the exact location of a resource within the entire DNS hierarchy, with no room for ambiguity.
In technical notation, an FQDN (Fully Qualified Domain Name) ends with a trailing dot representing the DNS root:
```
www.example.com.
```
That trailing dot is almost never shown in browsers or everyday use, but it exists conceptually at the top of the hierarchy. Let us now work through each component from right to left.
## Layer 1: The DNS Root (.)
At the very top of the DNS hierarchy sits the **root** — represented by a single dot (`.`). The root does not appear in domain names as you type them, but it is always there implicitly.
The root is managed by ICANN and operated by 13 clusters of root name servers distributed worldwide. These root servers are the starting point for all DNS (Domain Name System) lookups. They do not know the answer to any specific domain query — they only know where to send the query next: the appropriate TLD name servers.
## Layer 2: The Top-Level Domain (TLD)
Reading from right to left, the first component you encounter is the TLD (Top-Level Domain) — the Top-Level Domain. This is the segment after the final dot in a domain name:
- `example.**com**` → TLD is `.com`
- `wikipedia.**org**` → TLD is `.org`
- `bbc.co.**uk**` → TLD is `.uk`
- `myblog.**photography**` → TLD is `.photography`
The TLD (Top-Level Domain) is managed by a **registry** — an organization delegated authority by ICANN. For `.com`, that is Verisign. For `.uk`, that is Nominet.
The TLD defines the category or geographic scope of the domain:
- gTLD (Generic Top-Level Domain) (generic): `.com`, `.org`, `.net`, `.app`, `.shop`
- ccTLD (Country-Code Top-Level Domain) (country code): `.us`, `.uk`, `.de`, `.jp`
- sTLD (Sponsored Top-Level Domain) (sponsored): `.edu`, `.gov`, `.museum`
You choose the TLD when you register. You cannot change a TLD after registration without registering a new domain.
## Layer 3: The Second-Level Domain (SLD)
The SLD (Second-Level Domain) — Second-Level Domain — is the segment immediately to the left of the TLD. This is the part you choose and register:
- `**example**.com` → SLD is `example`
- `**wikipedia**.org` → SLD is `wikipedia`
- `**bbc**.co.uk` → SLD is `bbc` (with `.co` being a "pseudo-TLD" in the UK namespace)
The SLD (Second-Level Domain) is where your brand or identity lives. It is the most memorable and most valuable part of a domain name. Once registered, the combination of SLD and TLD (`example.com`) belongs to you exclusively for as long as you renew it.
Rules for second-level domains:
- May contain letters (a-z), digits (0-9), and hyphens (-)
- Cannot begin or end with a hyphen
- Cannot contain spaces or special characters (with the exception of internationalized domain names using Punycode encoding)
- Maximum length: 63 characters
- Minimum length: 1 character (though single-character domains are rare)
## Layer 4: The Subdomain
A **Subdomain** is any segment to the left of the SLD (Second-Level Domain). Subdomains are created and managed by the domain owner in their DNS settings — you do not register them separately, and they do not cost extra.
Common subdomains:
| Subdomain | Full Domain | Typical Use |
|-----------|-------------|------------|
| `www` | `www.example.com` | Main website (traditional) |
| `blog` | `blog.example.com` | Blog section |
| `shop` | `shop.example.com` | E-commerce store |
| `app` | `app.example.com` | Web application |
| `api` | `api.example.com` | Developer API endpoint |
| `mail` | `mail.example.com` | Webmail interface |
| `staging` | `staging.example.com` | Testing environment |
| `docs` | `docs.example.com` | Documentation site |
| `m` | `m.example.com` | Mobile site (legacy) |
You can create any subdomain you like for your domain. Each subdomain needs a corresponding DNS record (usually an A Record or CNAME Record) pointing to the appropriate server.
### Subdomains vs Subdirectories
A subdomain (`blog.example.com`) and a subdirectory (`example.com/blog`) are different ways to organize content. From a visitor's perspective, both work. From an SEO perspective, subdirectories are generally preferred for keeping link equity consolidated, while subdomains are treated more like separate sites by search engines. However, the technical differences matter far less than the quality of your content.
### Multi-Level Subdomains
You can chain multiple subdomains: `mail.london.example.com`. The DNS system can handle many levels, though practically speaking, more than two levels is uncommon.
## Layer 5: The Second-Level Domain in ccTLDs
Some country code TLDs use a two-segment structure with a "pseudo-TLD" layer:
- `bbc.co.uk` — `bbc` is the brand, `.co` is the type (commercial), `.uk` is the ccTLD
- `abc.gov.au` — `abc` is the brand, `.gov` is the type (government), `.au` is the ccTLD
- `mit.edu.in` — Similar pattern for India
In these cases:
- `.uk` (or `.au`, `.in`) is the TLD (Top-Level Domain)
- `.co.uk` (or `.gov.au`, `.edu.in`) functions as the effective registration namespace
- `bbc` (or `abc`, `mit`) is the brand segment
These are technically called **Second-Level Domains** within the registry's namespace, but the branding convention treats them as a combined "effective TLD."
## Putting It All Together
```
┌─────────────────────────────────────────────┐
│ www.example.com │
│ │ │ │ │
│ │ │ └─── TLD (.com) │
│ │ └─────────── SLD (example) │
│ └─────────────── Subdomain (www) │
└─────────────────────────────────────────────┘
```
```
┌─────────────────────────────────────────────────────────────┐
│ docs.api.example.co.uk │
│ │ │ │ │ │ │
│ │ │ │ │ └─── TLD (.uk) │
│ │ │ │ └────── Pseudo-TLD (.co) │
│ │ │ └────────────── SLD (example) │
│ │ └────────────────── Subdomain (api) │
│ └─────────────────────── Sub-subdomain (docs) │
└─────────────────────────────────────────────────────────────┘
```
## Who Controls Each Part?
| Component | Controlled By | How to Change |
|-----------|--------------|---------------|
| Root (`.`) | ICANN | Not applicable |
| TLD (Top-Level Domain) | Registry (e.g., Verisign for `.com`) | Cannot change TLD — must register new domain |
| SLD (Second-Level Domain) | Registrant (you) | Cannot change SLD — must register new domain |
| Subdomain | Domain owner (you) | Add/edit DNS records in your registrar or DNS provider |
| DNS records | Domain owner (you) | Edit in your DNS control panel |
## Practical Implications
**When setting up a new subdomain:**
Log into your DNS provider (which may be your Domain Registrar or a separate service like Cloudflare) and add an A Record or CNAME Record for the new subdomain.
**When configuring www vs non-www:**
Both `www.example.com` and `example.com` (the "apex" or "naked" domain) need DNS records. Typically, `www` uses a CNAME Record pointing to the apex, and the apex uses an A Record pointing to your server's IP. Many DNS providers support "CNAME flattening" or "ALIAS records" to handle the apex.
**When diagnosing DNS problems:**
Knowing which layer is misconfigured saves time. If `example.com` works but `www.example.com` does not, the subdomain DNS record is missing. If neither works, the issue is at the SLD level or higher.
## Key Takeaways
- A FQDN (Fully Qualified Domain Name) like `www.example.com` breaks into: root (`.`), TLD (Top-Level Domain) (`.com`), SLD (Second-Level Domain) (`example`), and Subdomain (`www`).
- The TLD (Top-Level Domain) is managed by a registry; you choose it at registration and cannot change it.
- The SLD (Second-Level Domain) is your brand name; you register it and cannot change it without registering a new domain.
- Subdomains are created freely by the domain owner using DNS records — no extra registration needed.
- Understanding domain anatomy helps with DNS configuration, troubleshooting, and SEO decisions.
Next, read How DNS Works: The Internet's Phone Book to understand how the DNS uses these components to route traffic, or intro-dns-records to learn how to configure the DNS records that point each part of your domain to the right server.