The whole journey in six steps
You type https://example.com/about in a browser and press Enter. Here is everything that happens, in order. This list is the map for the entire course.
- Parse the URL. The browser splits the address into pieces: which protocol, which server, which page.
- DNS lookup. The browser asks the DNS system to turn the name
example.cominto an IP address, something like93.184.215.14. (Unit 2) - TCP connection. The browser opens a reliable connection to that IP address. (Unit 3)
- TLS handshake. Because the URL starts with
https, the browser and server agree on encryption keys so nobody can read the traffic. (Unit 7) - HTTP request and response. The browser sends
GET /about, the server sends back the page. (Units 4 to 6) - Render. The browser turns the response into pixels, then repeats steps 2 to 5 for every image, stylesheet, and script the page needs.
All of this usually finishes in well under a second.
Quiz
Which happens first when you press Enter on https://example.com/about?
Anatomy of a URL
A URL (Uniform Resource Locator) is a structured address. Every part tells the browser something specific:
https://shop.example.com:443/cart/items?color=blue
└─┬─┘ └──────┬───────┘└┬┘└────┬────┘ └───┬────┘
scheme host port path query- scheme: which protocol to speak.
httpsmeans HTTP with encryption. - host: which server, by name. DNS will turn this into an IP address.
- port: a number that selects which program on that server should receive the connection — one machine runs many network programs at once, and the port tells them apart (unit 2 covers this). Usually omitted because
httpsimplies 443 andhttpimplies 80. - path: which resource on that server you want.
- query: extra key=value details after the
?, joined by&.
Because a URL is just text with separators, you can pull it apart with any programming language. Let's do it in bash, which you already know from the terminal.
Code exercise · bash
Run this script. It splits a URL into scheme, host, and target (path plus query) using bash's built-in text trimming: ${url%%://*} keeps everything before the first ://, and ${url#*://} removes it.
Code exercise · bash
Your turn. Extend the script to also split the target into a path and a query. Print three lines: host, path (before the ?), and query (after the ?). Use ${target%%\?*} to keep what is before the ? and ${target#*\?} to keep what is after it.