Domain Names and DNS
Computers can connect to addresses like IP addresses. People usually want names like developer.mozilla.org.
A domain name is the human-facing name. DNS is the lookup system that lets software turn that name into information needed to connect to the right service.
Domain Names Have Parts
Domain names are split by dots and become more general as you move to the right.
| Part | Example in developer.mozilla.org |
What it means |
|---|---|---|
| Top-level domain | org |
A broad registry area. Some are generic; some have stricter eligibility or country associations. |
| Second-level domain | mozilla |
The main registered name under the top-level domain. |
| Subdomain | developer |
A name controlled by the domain holder for a specific site, service, or area. |
The exact labels are case-insensitive. A domain holder can create many subdomains under a domain it controls.
DNS Lookup
The useful mental model is a cache-backed lookup chain:
- The browser receives a domain name from the user or a link.
- The operating system or browser checks whether it already has a fresh answer cached.
- If not, it asks a DNS resolver.
- The resolver finds the current records by consulting the DNS hierarchy and returns an address or another useful DNS answer.
- The browser can then connect to the destination and speak a protocol such as HTTP.
Caching makes the system faster, but it also explains why DNS changes are not always visible everywhere at the same moment. Old answers can remain usable until their cache lifetime expires.
Registration Is a Right to Use
A domain name is not owned forever like a physical object. A registrant pays for the right to use a name for a period of time through a registrar. The registrar and registry keep the administrative and technical records needed for the domain to resolve.
That distinction matters operationally. If registration expires or records are misconfigured, the service may still exist, but users may no longer be able to find it by name.
Design Check
When debugging a website, separate these questions:
- Does the domain resolve to the expected address?
- Are stale DNS caches still pointing somewhere old?
- Is the destination reachable once the address is known?
- Is the application protocol, such as HTTP, succeeding after connection?