Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
The Web and Markup  ›  Lesson

How a Page Reaches You: Domains, DNS, HTTP and Hosting

What is HTTP? 12 minTyping 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.

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.org
HTTP/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.

Following https://example.org/menu.htmlStep 1 of 5
  1. 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.

quick drill

What does DNS do?

quick drill

A server replies with status 404. What does that mean?

quick drill

In https://shop.example.com/cart, which part is the path?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainThe journey of a URL

Someone types https://example.org/menu.html into a browser and presses Enter. Describe, step by step, what happens before any HTML appears on their screen. Use the words domain name, DNS, HTTP request, server and response.