Domains and Subdomains
When you see a web address like "blog.example.com," you're looking at a hierarchical naming system. Each part of the name has meaning, and understanding this structure helps you work with DNS and web hosting.
Think of it like a postal address, but read backwards. Instead of "123 Main Street, Springfield, USA," domain names go from specific to general, right to left: subdomain.domain.top-level-domain.
The Domain Hierarchy
Top-Level Domain (TLD) is the rightmost part: .com, .org, .net, .io, .uk. These are managed by designated organizations. Some TLDs indicate purpose (.edu for education, .gov for government), while others indicate country (.uk, .de, .jp).
Second-Level Domain is what you typically register: google in google.com, wikipedia in wikipedia.org. This is "your" domain — the name you purchase and control.
Subdomain is anything you add to the left of your domain: www.example.com, blog.example.com, api.example.com. You can create unlimited subdomains without additional registration.
Reading Domain Names
Let's break down "docs.google.com":
- com — Top-level domain (commercial)
- google — Second-level domain (Google's registered name)
- docs — Subdomain (Google's documentation service)
The hierarchy flows right to left, from general to specific. DNS lookups follow this same path, starting at the TLD and working down.
Why Subdomains Matter
Subdomains let you organize different services under one domain:
- www.example.com — Main website
- api.example.com — API server
- mail.example.com — Email server
- staging.example.com — Testing environment
Each subdomain can point to a different IP address or server. This flexibility is why large organizations use many subdomains.
Domain Ownership
When you register a domain, you're essentially renting the right to control that name's DNS records. You can create any subdomains you want, point them wherever you choose, and configure various DNS records for different purposes.
Domain registration typically costs $10-50 per year, depending on the TLD. Premium or short domain names can cost significantly more.