Domain Names, DNS & Hosting

Beginner · 24 min

What a domain name actually is, how DNS resolves it to a server, and where a website physically lives once it's "hosted."

Before thisHow the Internet and the Web Work

NetworkChuck · 24 min

Domain Names, DNS & Hosting

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by NetworkChuckReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • A domain name is a rented, human-readable alias for an IP address — you don't own it outright, you lease it from a registrar for a renewable term.
  • DNS resolution is a hierarchy, not a single lookup: a resolver works from root servers down to TLD servers down to the domain's own authoritative nameserver to find the answer.
  • Different record types answer different questions — an A record maps a name to an IPv4 address, a CNAME maps a name to another name, and an MX record says where that domain's email should go.
  • Hosting means renting space on someone else's always-on server so your site's files are reachable at any hour, rather than running it off a machine in your home.
  • A CDN keeps cached copies of your site's static files on servers physically close to visitors around the world, so a user in Tokyo isn't waiting on a round trip to a server in Virginia for every image.

The name is not the thing

A few lessons ago, you learned that every machine on the internet has an IP address, and that DNS exists to translate names into those addresses so humans don’t have to memorize numbers. This lesson goes one level deeper on both halves of that idea: what a domain name actually is as a piece of infrastructure, how the DNS lookup actually unfolds step by step, and what it means for a site to be “hosted” somewhere once its address resolves.

A domain name is a lease, not a deed

When you “buy” a domain name, you’re not buying property — you’re renting a line in a shared global database for a fixed term, usually a year, from a company called a registrar. The registrar doesn’t own the namespace either; it’s accredited to sell registrations within it by a higher authority for that top-level domain (.com, .dev, .io), which is in turn overseen by ICANN, the organization that coordinates the entire global namespace so two people can’t register the identical name out from under each other.

This matters practically, not just as trivia: if you forget to renew a domain, it doesn’t quietly stay yours — it enters a grace period and then becomes available for anyone else to register. Companies have genuinely lost valuable domains this way. A domain name, as infrastructure, is best understood as a long-running subscription, not a one-time purchase.

The resolution hierarchy

Here’s the part most explanations skip past too quickly: DNS resolution for www.example.com is not one lookup, it’s a hierarchy of them, and it mirrors the structure of the name itself, read right to left.

Your computer first asks a resolver — usually run by your ISP or a public one — “where is www.example.com?” If that resolver has answered this recently, it just returns the cached answer and resolution ends here, which is the common case. If not, the resolver starts at the top. It asks a root server, essentially “who manages .com?” The root server doesn’t know the final answer, but it knows who to point to next — the servers responsible for the .com top-level domain (TLD).

The resolver then asks a .com TLD server, “who’s authoritative for example.com specifically?” That TLD server points to example.com’s own authoritative nameserver — typically run by whoever manages the domain’s DNS, often the hosting provider. Finally, the resolver asks that authoritative nameserver directly, “what’s the address for www.example.com?” and gets back an actual IP address, which it hands to your browser and also caches for next time.

Four hops, each one narrowing the search — root, TLD, authoritative nameserver, answer — all of it typically completing in well under a second, invisibly, before your browser can even open a connection.

Records: different questions, different answer types

An authoritative nameserver doesn’t just store one fact about a domain — it stores a set of records, each answering a different kind of question:

An A record maps a name directly to an IPv4 address — the most direct kind of entry, literally “this name means this number.”

A CNAME record maps a name to another name instead of an address, telling the resolver “go look up this other domain instead, and use whatever it resolves to.” This is common for subdomains — www.example.com might be a CNAME pointing at example.com, so only one record ever needs updating if the underlying address changes.

An MX record has nothing to do with web pages at all — it tells the world which mail servers should handle email addressed to that domain. This is why a domain can serve a website and receive email through two entirely different services, configured through two entirely different record types, without conflict.

There are more record types (TXT, AAAA for IPv6, and others), but A, CNAME, and MX cover the large majority of what you’ll touch setting up a basic site.

What “hosting” actually means

Resolving a name gets you an IP address — but there has to be an actual, always-on machine answering at that address, ready to respond to requests at 3 a.m. on a Tuesday just as reliably as at noon. That’s what hosting is: paying a provider to run your site’s files on hardware that’s online continuously, has a stable IP, and has enough bandwidth to handle however many visitors show up. Running a site “yourself” off a machine in your house is technically possible and almost never done in practice — home internet connections aren’t built for the uptime and bandwidth guarantees a real audience needs, and your IP address usually isn’t even fixed.

Modern hosting ranges from a single traditional server, to serverless platforms that spin up compute only when a request arrives, to static hosting that just serves pre-built files with no server-side computation at all. The common thread across all of them is the same: someone else’s always-on infrastructure, reachable at the address your domain’s A or CNAME record points to.

CDNs: moving the content closer to the visitor

One more piece completes this picture. If your server lives in, say, Virginia, a visitor in Tokyo requesting your homepage has to wait for that request to physically cross the Pacific and back, every single time, for every file. A content delivery network, or CDN, solves this by caching copies of your static files — images, stylesheets, scripts, sometimes whole pages — on servers distributed in data centers around the world. When that visitor in Tokyo requests your site, they’re served from a nearby cached copy instead of the original server on the other side of the planet, which can turn a few-hundred-millisecond round trip into a few-millisecond one.

This is purely a conceptual introduction — the deeper mechanics of cache invalidation and edge computing are their own topic — but the core idea is one you’ll see constantly once you start deploying real projects: distance is latency, and a CDN’s entire job is shrinking that distance for as many visitors as possible.

With this lesson, you’ve now covered the full path from typing a name to a page rendering on screen: the network itself, the names and hosting behind it, the protocol the browser and server speak, and what the browser does with what comes back. Everything in the rest of this roadmap builds on top of that foundation.

Check yourself

  1. 01Do you ever truly "own" a domain name?

    No. You lease it from a registrar for a renewable period — typically a year at a time — and it reverts to being available if you stop renewing it.

  2. 02What's the difference between an A record and a CNAME record?

    An A record points a domain name directly at an IPv4 address. A CNAME points a domain name at another domain name instead, letting that second name's own records resolve the rest of the way.

  3. 03What does an MX record control?

    Which mail servers should receive email sent to addresses at that domain — it has nothing to do with where the website itself lives.

  4. 04Why does a CDN make a site feel faster for users far from its main server?

    Because it keeps cached copies of static files on servers distributed around the world, so a visitor's request is served from a nearby location instead of traveling all the way to the original server and back.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark