Module 1 · 1.2
How a domain name is structured
Module 1: What is DNS? · Reading time: 7 minutes
Learning goal: After this lesson, you can name the parts of a domain name and read a name from right to left.
Key concepts: label, TLD (ccTLD and gTLD), second level, subdomain, root, trailing dot, FQDN, maximum length
A name consists of labels
Take the name www.shop.example.nl. It consists of four parts, separated by dots: www, shop, example and nl. Each part is called a label.
You read a domain name from right to left. On the right is the most general part, on the left the most specific. It's the same with a postal address: you write the name first and the country last, but the postal service looks for the country first and the person last. You write a domain name the same way, from specific to general, with the country (or another category) on the right and the name of the computer on the left. That's why DNS reads it from right to left: the country first, the name of the computer last.
The tree
DNS is structured as an upside-down tree:
. (root)
┌─────────┼──────────┐
nl com org
┌───┴───┐ │ │
example sidn google wikipedia
┌──┴──┐
www shop
│
www- At the top is the root, the root of the tree. It has no name. You write it as a single dot.
- Below that are the top-level domains or TLDs:
nl,com,org,de,beand over a thousand others. - Below that are the names you can register, such as
exampleundernl. This is called the second level. Together they formexample.nl: your domain name. - Anything you add yourself to the left of that is a subdomain:
www.example.nl,shop.example.nl, and evenwww.shop.example.nl. You don't need to register these. As the registrant ofexample.nl, you create them yourself, as many as you like.
Types of top-level domains
There are two main types of TLDs:
| Type | Meaning | Examples |
|---|---|---|
| ccTLD (country code) | A two-letter country code | .nl (the Netherlands), .be (Belgium), .de (Germany), .eu (European Union) |
| gTLD (generic) | A general category or brand name | .com, .org, .net, .info, and newer ones such as .shop, .amsterdam, .app |
Strictly speaking, .eu isn't a country, but it's treated as a ccTLD. Every TLD has its own rules: who can register, for how long, how transfers work. These rules are set by the TLD's registry (see lesson 1.3).
Some countries work with an extra level. In the United Kingdom, for example, you often register under .co.uk. With example.co.uk, uk is the TLD, but you register at the third level. For how DNS works, this makes no difference: it's simply one more label.
The trailing dot
Officially, every full name ends with a dot, as in www.example.nl. (note the dot at the end). That final dot is the root. You never type it in your browser, because your browser quietly adds it for you. But in a DNS panel, it matters.
A name that ends with a dot is called a fully qualified name or FQDN (fully qualified domain name). A name without a trailing dot is often treated in a DNS panel as a relative name: the panel appends your own domain name to it.
Say you manage the DNS for example.nl and you enter mail.exampledomain.nl as the value of a record, without a dot. Then the panel actually turns it into:
mail.exampledomain.nl.example.nl.That name doesn't exist, and your record won't work. With a trailing dot (mail.exampledomain.nl.), it's correct. This is one of the most common mistakes in DNS. Lesson 2.2 covers this in more detail. Some panels add the dot for you automatically or warn you; always check how the record looks after saving.
Capital letters, characters and length
- Capital letters don't matter.
Example.NLandexample.nlare the same name. - Allowed characters for hostnames are letters, digits and the hyphen (not at the start or end of a label). Names with letters such as é or ü (IDN, internationalized domain names) also exist. They're stored in DNS as a code starting with
xn--. For example,café.nlbecomesxn--caf-dma.nl. - An underscore (
_) appears in technical names such as_dmarc.example.nlorselector1._domainkey.example.nl. These aren't meant as website addresses, but for special records (module 4). - Maximum length: a single label may be up to 63 characters, and the whole name up to 253 characters (excluding the final dot). This is set out in RFC 1035.
Where's your domain name, and where's your subdomain?
The distinction between domain name and subdomain matters in practice:
- The domain name (
example.nl) is what you register and pay for at a registrar. That's also where you set the nameservers. - Subdomains (
www,shop,mail) are ones you create yourself in your domain's DNS. You don't need a registrar for this.
In this course, we call the name example.nl itself, without anything in front of it, the bare domain. In technical terms, this is called the apex or zone apex. In panels, it's often written as @.
Summary
- A domain name consists of labels separated by dots; you read it from right to left.
- On the right is the TLD (ccTLD such as
.nlor gTLD such as.com), before that the registered name, before that any subdomains. - The root is a single dot; a name with a trailing dot is a fully qualified name (FQDN).
- Without a trailing dot, a panel appends your own domain name to it.
- A label is at most 63 characters, a full name at most 253; capital letters don't count.
Quiz
Exercise
Exercise Z1.2: Breaking down a name. Take the name nl.wikipedia.org. Fill in: (1) the TLD, (2) the registered domain name, (3) the subdomain. Then look up which nameservers the TLD org has (NS record of org.) and enter one of them.
Further reading
These articles describe the situation at WebOké. With other providers, it works in a similar way.
