How a Page Reaches You: Domains, DNS, HTTP and Hosting
Typing a web address triggers a DNS lookup that turns the domain name into a server address, then an HTTP request to that hosting server, which answers with the HTML file.
Follow a navigation through name resolution, a request and the returned document.
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.