Skip to content
HACKME

Level 1 · 1C How the internet works · Lesson 1 of 3

What happens when you open a website

2 min read · Free · From scratch

When you type an address, your browser (the program that requests pages and shows them to you) doesn't know where that website is. It asks DNS, the internet's address book, which turns a name like google.com into an IP address: the home address of the computer where the website lives.

That computer is called a server: it stores the website and answers requests. The browser connects, asks for the page, and the server sends it. If the connection is HTTPS, that whole road is encrypted and nobody in the middle can read it.

The website can also leave a cookie in your browser: a small note used, for example, to remember that you already logged in, so it doesn't ask for your password on every click.

Going deeper

See it with your own eyes

nslookup google.com
curl -I https://google.com
What this code does:
  • nslookup asks DNS what the IP address of google.com is.
  • curl -I asks only for the headers of the server's response: it will show the status code (200, 301…), the type of server, and other clues.
  • Both commands only ASK; they don't attack anything. Try them in a terminal.

Review questions

What is DNS for?

Answer: To turn a name like google.com into the server's IP address. It's the internet's address book: humans use names, computers use IP addresses.

What is a server?

Answer: A computer that stores a website and answers requests. Every website lives on a server. If the server has a hole, so does the website.

What is a cookie?

Answer: A note the website saves in your browser, for example to remember that you already logged in. Cookies are used to remember things between visits. That's why session cookies are valuable and need protecting.