A domain name is a path through a tree, read right to left: in www.example.com, com is a top-level domain run by a registry, example is the name someone registered under it through a registrar, and www is a subdomain the owner created themselves. Each level delegates control of the level below it, and the Domain Name System (DNS) follows that chain of delegation to turn the name into an IP address.
The parts of a domain name
A domain name is a list of labels separated by dots. RFC 1034 defines the name of a node as "the list of the labels on the path from the node to the root of the tree". The most specific label comes first:
| Label | Name | Who controls it |
|---|---|---|
| (empty) | The root, written as a final dot | IANA, coordinated by ICANN |
com | Top-level domain (TLD) | The registry for .com (VeriSign, per IANA's root zone database) |
example | Second-level domain, the part you register | The registrant (you), through a registrar |
www | Subdomain | The registrant, freely, in their own DNS records |
The root has a zero-length label. That's why a fully written-out domain name ends in a dot, www.example.com., and why some tools print it that way. Browsers and most software add the trailing dot for you.
Some country domains add an extra level that works like a TLD. In bbc.co.uk, the registry for .uk (Nominet UK, per IANA) offers names under co.uk, so bbc is the registered part.
Rules for valid domain names
- Length: each label is at most 63 octets; the whole name at most 255 octets (RFC 1035, section 2.3.4).
- Characters: the traditional host name rule is letters, digits and hyphens, starting with a letter and ending with a letter or digit. RFC 1123 later relaxed the first-character rule to "either a letter or a digit". Internationalised names such as
bücher.exampleare carried in DNS as an ASCII form called an A-label, which always begins withxn--(RFC 5890). For example, Python's"bücher".encode("idna")returnsxn--bcher-kva. - Case: DNS ignores it. RFC 1035 says comparisons "are done in a case-insensitive manner", so
EXAMPLE.comandexample.comare the same name.
Who runs the top-level domains
The list of TLDs lives in the root zone, which IANA maintains. As of 26 October 2026, IANA's published list contained 1,437 TLDs. They fall into two everyday groups:
- Generic TLDs such as
.com,.org,.netand newer ones like.appor.dev. ICANN "draws up contracts with each registry" that runs one. - Country-code TLDs, two letters, such as
.uk,.deor.io. Each has its own manager; ICANN notes that some have no formal agreement with it, and their registration rules vary by country.
You can look up who runs any TLD on IANA's Root Zone Database page.
Registry, registrar, registrant: who does what
Three roles show up every time you register a name:
- Registry: the operator of a TLD. It keeps the master list of every name registered under it and publishes the TLD's DNS zone.
- Registrar: the company you buy from. ICANN's wording: "Registrars are accredited by ICANN organization and certified by the registries to sell domain names." ICANN says more than two thousand registrars are accredited. Resellers can sell on a registrar's behalf, but the registrar stays responsible for those names.
- Registrant: you, the person or organisation the name is registered to.
For country-code TLDs, ICANN notes that registrations go through the ccTLD operator, which may or may not use a registrar model.
What happens when you register a domain
- You search for a name at a registrar. The registrar asks the registry whether it's available.
- You pay for a registration period. The registrar creates the record at the registry with your contact details and an expiry date.
- You (or the registrar by default) set the domain's nameservers: the servers that will answer DNS questions for your name. The registry publishes these in the TLD's zone. This entry is the delegation that makes your domain work.
- On your nameservers you create records:
AandAAAAfor IP addresses,MXfor email,CNAMEfor aliases, and so on. Subdomains such aswwworshopare just more records here; no registrar is involved. - Before the expiry date you renew. If you don't, the name eventually returns to the pool.
See the delegation chain yourself
nslookup works on Windows, macOS and Linux. Ask who the nameservers for the root are (example output, trimmed):
nslookup -type=NS .
(root) nameserver = m.root-servers.net
(root) nameserver = f.root-servers.net
(root) nameserver = j.root-servers.net
...
The root servers are named a through m; ICANN describes them as 13 root server addresses pointing at a shared index of TLDs. Next, who answers for .com:
nslookup -type=NS com.
com nameserver = a.gtld-servers.net
com nameserver = b.gtld-servers.net
...
com nameserver = m.gtld-servers.net
And finally, which nameservers .com delegates example.com to. When we ran this on 26 October 2026 the answer was:
nslookup -type=NS example.com
example.com nameserver = hera.ns.cloudflare.com
example.com nameserver = elliott.ns.cloudflare.com
Root, then TLD, then the domain's own nameservers: that is the chain a resolver walks. How DNS works follows a single lookup through each step, including caching.
Look up a domain's registration (RDAP)
Registration data (registrar, creation and expiry dates, status) is published through RDAP, the Registration Data Access Protocol. ICANN made RDAP "the definitive source" for generic TLD registration data on 28 January 2025, replacing the older WHOIS services. Use ICANN's web tool at lookup.icann.org, or query a registry's RDAP server directly. For a .com name:
curl -s https://rdap.verisign.com/com/v1/domain/example.com
The JSON response for example.com included, among other fields (summarised):
registration 1995-08-14T04:00:00Z
expiration 2027-08-13T04:00:00Z
registrar RESERVED-Internet Assigned Numbers Authority
nameservers ELLIOTT.NS.CLOUDFLARE.COM, HERA.NS.CLOUDFLARE.COM
status client delete prohibited, client transfer prohibited, client update prohibited
The "client ... prohibited" statuses are locks the registrar has set to block unauthorised changes and transfers. For your own domain, a transfer lock is worth keeping on unless you're moving to another registrar.
Domain names vs URLs vs IP addresses
- A URL such as
https://www.example.com/docs/page?id=1contains a domain name (www.example.com) plus a scheme, path and query. - An IP address is what the domain name resolves to. Several names can point at one address, and one name can have several addresses.
- Your computer checks its hosts file before asking DNS, which is why an entry there can override any domain on that one machine.
localhostis a special case that always means your own machine; see what is localhost.
Frequently asked questions
- Do you own a domain name once you buy it?
- You register it for a fixed period and keep the right to use it as long as you renew on time. The registry for the top-level domain holds the authoritative record, and your registrar manages it on your behalf. If you let the registration lapse, the name eventually becomes available for someone else to register.
- Are domain names case-sensitive?
- No. The DNS specifications say comparisons between labels and domain names are done case-insensitively, so Example.COM and example.com are the same name. The part of a URL after the domain, the path, can be case-sensitive depending on the web server.
- What is the difference between a domain and a subdomain?
- Technically every name is a subdomain of the one to its right: example.com is a subdomain of com. In everyday use, the domain is the name you registered (example.com) and a subdomain is any name you create under it yourself (www.example.com, shop.example.com) without paying a registrar again.
- How long can a domain name be?
- Each label between dots can be up to 63 octets, and the whole name up to 255 octets in wire format, per RFC 1035. Registries can set stricter rules for what they accept, such as a minimum length or which characters are allowed.
Sources
- RFC 1034: Domain Names, Concepts and Facilities
- RFC 1035: Domain Names, Implementation and Specification
- ICANN: What Does ICANN Do?
- ICANN: Registering a domain name
- RFC 1123: Requirements for Internet Hosts (host name syntax)
- RFC 5890: Internationalized Domain Names for Applications, Definitions
- IANA: Root Zone Database
- IANA: List of top-level domains (text file)
- ICANN: Launching RDAP; Sunsetting WHOIS (January 2025)