How a Page Reaches You: Domains, DNS, HTTP and Hosting
Your HTML file sits on a computer somewhere. A visitor types an address on the other side of the world and, half a second later, sees your page. Knowing the steps in between helps you understand broken links, "404 Not Found" pages and why the same file behaves differently on your laptop and on the internet.
The rule
Name, then number, then ask, then answer.
Four pieces work together:
- Domain name — the human-friendly name, like
example.org. You rent it from a registrar. - DNS (Domain Name System) — the internet's phone book. It turns a name into an IP address, the number that identifies a server, such as
93.184.215.14. - Hosting — a computer (server) that is always on and connected, storing your files and waiting for requests.
- HTTP (HyperText Transfer Protocol) — the language browser and server use to talk. The browser sends a request; the server returns a response.
A simplified request and response look like this:
GET /menu.html HTTP/1.1
Host: example.orgHTTP/1.1 200 OK
Content-Type: text/html
<!DOCTYPE html>
<html>...</html>GET means "please give me this resource". 200 OK is a status code meaning success. You will also meet 404 (not found) and 500 (the server had an error). HTTPS is HTTP with encryption, so nobody in between can read or alter the page; today it is the normal choice.
The shortcut
Read any URL from left to right and you have the whole journey: protocol, domain, path.
Protocol: https
The browser will speak HTTP over an encrypted connection.
The common mistake is thinking the domain is the website. The domain is only a name pointing at a server. Change where DNS points and the same name shows a different site.
You can watch this happen. Open your browser's developer tools (right-click the page, choose Inspect) and switch to the Network tab, then reload. Every row is one HTTP request, with its status code and how long it took. The first row is usually the HTML itself; the rest are the files it asked for.
Drills
Answer fast — trust the rule.
What does DNS do?
A server replies with status 404. What does that mean?
In https://shop.example.com/cart, which part is the path?
A page includes one stylesheet and two images. How does the browser get them?
Remember
- Name, then number, then ask, then answer: domain, DNS, HTTP request, response.
- Shortcut: read a URL as protocol, domain, path.
- Trap: the domain is only a name; hosting is where the files actually live.
