Study Guide

How a Web Page Is Loaded

What happens between typing a web address and seeing the page: the browser, a DNS lookup that returns the IP address, a request to the web server, the HTML coming back and being rendered; and how cookies, session and persistent, let a website recognise a browser, with their privacy risks.

Lesson 4.7 Networks, the Internet and Security

For: Cambridge IGCSE Computer Science learners, or anyone who has wondered what a browser does in the moment before a page appears

Stage: Think

The pause before the page

Mia is in her school library. She types https://www.example.org/science/magnets.html into the address bar of a browser and presses Enter. A second later a page about magnets appears. The school and the website are fictional.

Think it through

In that second, a lot of things must happen between the browser and other computers. List, in order, what you think happens between pressing Enter and the page appearing.

Show a model answer

There is no single right list yet, but a good one has these ideas: the browser has to find the computer that holds the page; it has to ask that computer for the page; the computer has to send the page back; and the browser has to turn what comes back into something you can see. This lesson fills in each part.

Stage: Discover

Names for people, numbers for computers

When you call a friend, you tap their name in your contacts. The phone network does not connect names, though: it connects numbers. So the phone looks the name up in the contacts list and uses the number it finds.

Think it through

Mia typed a domain name, www.example.org. Computers on the internet are found by their IP addresses, which are numbers. What does the browser need to do before it can contact the website, and where might it get what it needs?

Show what happens

The browser needs the IP address that belongs to the domain name, like a number for a name. It cannot work that out itself, so it needs a list to look it up in, kept on some other computer.

That list is held by a domain name server, also called a DNS server (DNS stands for domain name system). Its job is to hold records that link domain names to IP addresses, and to give the IP address back when it is asked for a domain name. A DNS server is like a huge, always up-to-date contacts list for the internet. If the first DNS server asked has no record of a name, it asks other DNS servers on the browser’s behalf.

The computer that stores the website and sends out its pages is the web server. It has an IP address, and the DNS server’s record says what that address is. Here are three records from a fictional DNS server, using addresses set aside for examples:

Domain nameIP address
www.example.org203.0.113.25
learn.example.com198.51.100.7
shop.example.com203.0.113.80

Check your understanding

A browser asks a DNS server about www.example.org, using the records above. What does the DNS server send back?
Show the answer

Answer: A. 203.0.113.25, the IP address of the web server.

The DNS server returns an IP address. It never holds the page.

Stage: Predict

Put the journey in order

You now know every part of the journey: the browser, the DNS server, the IP address, the web server and the HTML. Six things happen when Mia presses Enter, but they are listed below in a mixed-up order.

Number the events from 1 (first) to 6 (last)
What happensOrder
The web server sends the HTML for the page back to the browser
The browser reads the URL and picks out the domain name
The browser renders the HTML and shows the page
The DNS server sends the IP address back to the browser
The browser sends a request for the page to the web server
The browser asks a DNS server for the IP address that goes with the domain name

    Show the completed table
    What happensOrder
    The web server sends the HTML for the page back to the browser5
    The browser reads the URL and picks out the domain name1
    The browser renders the HTML and shows the page6
    The DNS server sends the IP address back to the browser3
    The browser sends a request for the page to the web server4
    The browser asks a DNS server for the IP address that goes with the domain name2

    Write a number from 1 to 6 in each blank cell.

    Mia’s browser loads https://www.example.org/science/magnets.html

    Each step names the device that acts. Check each one against the order you chose.

    1. Mia’s browser

      Step 1 of 6: It reads the URL

      The browser splits the URL. The protocol is https, the domain name is www.example.org and the page is science/magnets.html. The domain name is what it needs to look up.

    2. Mia’s browser

      Step 2 of 6: It asks the DNS server for the IP address

      The browser sends the domain name to a DNS server, because it can only contact a web server by its IP address.

      Technical detail: The school network tells each device which DNS server to use when the device joins the network.

    3. The DNS server

      Step 3 of 6: It looks up the name and sends back the IP address

      The DNS server finds the record for www.example.org and sends back its IP address, 203.0.113.25.

      Technical detail: If this server has no record, it asks other DNS servers. If none knows the name, the browser shows an error such as “server not found”.

    4. Mia’s browser

      Step 4 of 6: It sends a request to the web server

      Using the IP address, the browser sends a request for science/magnets.html to the web server. The request travels as packets, passed on by routers.

    5. The web server at 203.0.113.25

      Step 5 of 6: It finds the page and sends back the HTML

      The web server finds the file and sends its HTML back to the browser, again as packets.

      Technical detail: If the server has no such file, it sends back an error message instead, such as “404 Not Found”.

    6. Mia’s browser

      Step 6 of 6: It renders the HTML and shows the page

      The browser works out what each tag in the HTML means and draws the page about magnets. If the page needs images, the browser requests them from the web server in the same way.

    Stage: Explain

    Following one request

    Liam types https://learn.example.com/maths/fractions.html. Use the three DNS records from earlier.

    1. Read the URL. The protocol is https, the domain name is learn.example.com, and the page is maths/fractions.html. The browser needs the domain name, because that is what the DNS server stores records for.
    2. Ask the DNS server. The browser sends “learn.example.com” to the DNS server. Why: the browser has a name, and it needs the number to contact a computer.
    3. Read the reply. The DNS server finds the record: learn.example.com has the IP address 198.51.100.7. Why this one and not 203.0.113.25: the records link each name to exactly one address, and 203.0.113.25 belongs to www.example.org.
    4. Send the request. The browser sends a request for maths/fractions.html to 198.51.100.7. Why: that is where the web server for this domain name is.
    5. Receive and render. The web server sends back the HTML, and the browser renders it. Liam sees the page.

    Apply it

    Priya types https://shop.example.com/offers/today.html. Using the records, to which IP address does her browser send the request for the page?
    Show the answer

    Answer: C. 203.0.113.80, because that is the record for shop.example.com.

    The whole domain name matters: shop.example.com has its own record, and its own web server.

    Apply it

    Noah says: “The browser asks the web server for the IP address, because the web server knows where the page is.” What is wrong with this?
    Show the answer

    Answer: A. The browser has to get the IP address from a DNS server first, as it cannot contact the web server without it.

    The DNS server comes first, because the browser needs the web server’s IP address before it can ask the web server for anything.

    Apply it

    A pupil mistypes the domain name as www.exmaple.org, and the browser shows “server not found”. Which step has failed?
    Show the answer

    Answer: D. The DNS lookup failed, as the DNS server has no record for the misspelt domain name.

    No record means no IP address, so the browser never gets as far as asking a web server for the page.

    Stage: Think

    A shop that forgets you

    Fatima is looking at a fictional online shop. She adds a pair of trainers to her basket, then opens another page to look at socks. The basket on the new page still shows the trainers.

    Each request a browser sends is separate, and a web server does not remember by itself who sent the previous one.

    Think it through

    How could the shop’s web server work out that the second request comes from the same browser as the first, so that it shows the same basket? Hint: what could the browser carry with it?

    Show a model answer

    The server can give the browser a small piece of information, like a cloakroom ticket, and ask the browser to keep it and send it back with every later request. The server then matches the ticket to the right basket.

    That ticket is a cookie: a small text file that a website asks a browser to store. Whenever the browser asks the same website for another page, it sends the cookie back with the request, so the website can recognise it.

    1. Fatima’s browser

      Step 1 of 5: It asks for a shop page for the first time

      The browser has no cookie from this shop yet, so it sends none.

    2. The shop’s web server

      Step 2 of 5: It sends the page and asks for a cookie to be stored

      With the page, the server sends a cookie that holds a code, for example basket=A7Q3. The code is made up by the shop for this visit.

    3. Fatima’s browser

      Step 3 of 5: It stores the cookie

      The browser saves the cookie in its cookie store, filed under the shop’s website.

    4. Fatima’s browser

      Step 4 of 5: It sends the cookie back with her next request

      Fatima adds the trainers. The request for this carries the code A7Q3. The server finds the basket linked to that code and adds the trainers to it.

    5. The shop’s web server

      Step 5 of 5: It recognises the browser on every later page

      The request for the socks page carries the same code, so the server shows the same basket, with the trainers in it.

    A cookie lets a website remember a browser. The uses in the specification are:

    • saving personal details: a name or address typed into a form, so that it is filled in next time;
    • tracking user preferences: the language chosen, a dark or light theme, the text size;
    • holding items in an online shopping cart (a basket), as in Fatima’s example;
    • storing login details, so that a user stays logged in as they move around the site. A well-built website stores a code that identifies the login, not the password itself.
    A video website remembers that a pupil chose subtitles in French, so subtitles are on next time. Which use of cookies is this?
    Show the answer

    Answer: C. Tracking user preferences.

    A remembered choice, such as a language, is a user preference.

    Stage: Explain

    Cookies and privacy

    Cookies are useful, but they hold information about a person, and sometimes many websites share it.

    Think it through

    A pupil uses a library computer and ticks “keep me logged in” on a website. They walk away without logging out. What could go wrong, and which kind of cookie is involved?

    Show a model answer

    The next person to use the computer could open the same website and find the pupil already logged in, able to see their personal details and messages. A persistent cookie keeps the login after the browser closes, which is what makes it risky on a shared device.

    Things to think about with cookies:

    • Personal data stored on a shared device. Saved names, addresses and logins can be seen by the next user. Log out and delete cookies on a computer that is not yours.
    • Tracking. Some cookies come from advertising companies whose content appears on many websites. They can note which websites the same browser visits and build up a picture of a person’s interests.
    • Consent. In the UK, a website must ask permission before it sets cookies that it does not need in order to work, and a user can say no. Basket cookies are usually allowed without asking, because the basket cannot work without them.
    • User control. A user can see, delete and block cookies in the browser’s settings. Deleting them also removes saved baskets and logins.

    A cookie is plain text data. It is not a program, so it cannot run on a device or carry a virus. The worry about cookies is about privacy, because of what they let a website remember and what they let other companies learn.

    Apply it

    A fictional news website sets cookies from an advertising company on every page. Which privacy concern is most directly raised?
    Show the answer

    Answer: D. The company may track which websites the same browser visits and build a profile of the person.

    Cookies from a company that appears on many sites can be used to follow one browser from site to site.

    Stage: Consolidate

    Show what you know

    Think it through

    Explain to a friend what happens from typing a URL to seeing the page. Use the words browser, domain name, DNS server, IP address, web server, HTML and render.

    Show a model answer

    A good answer: “The browser takes the domain name from the URL and asks a DNS server for the IP address that goes with it. The DNS server looks the name up and sends the IP address back. The browser then uses the IP address to send a request to the web server, which sends back the HTML of the page. The browser renders the HTML and shows the page.”

    Apply it

    A pupil’s browser shows a page on one website with no trouble, but another website shows “server not found”, and its address is spelt correctly. Which explanation fits best?
    Show the answer

    Answer: B. The DNS server found no IP address for the second domain name, so the browser had nowhere to send its request.

    The lookup is a separate step, and each website has its own record.

    An online bank wants a cookie to keep its customers logged in while they move around the site, but it must not stay on a shared computer after the window is closed. Which is the best choice, and why?
    Show the answer

    Answer: C. A session cookie, because it is deleted when the browser is closed.

    A session cookie ends with the browser, so a shared computer is left logged out.

    • When a URL is entered, the browser takes the domain name, asks a DNS server for the matching IP address, sends a request to the web server at that address, receives the HTML, and renders it.
    • A DNS server holds records linking domain names to IP addresses. If it has no record, the lookup fails and no request is sent.
    • A cookie is a small text file stored by the browser and sent back to the website with later requests, so the site can recognise the browser. Uses include saving personal details, tracking preferences, holding a shopping cart and storing login details.
    • A session cookie has no expiry date and is deleted when the browser closes; a persistent cookie has an expiry date and stays until then or until it is deleted.
    • Cookies raise privacy concerns: data left on shared devices, tracking across websites, and the need for consent. A cookie is text, not a program.

    Sources and scope

    • What this lesson is. The seventh lesson of the Networks, the Internet and Security module, written for this site. Its curriculum links are provisional: the wording of each linked specification point has been checked against the published specification, but no link has been verified by the site owner, and the links imply no endorsement by any examination board. The links were written against the Cambridge IGCSE Computer Science 0478 specification for 2026 to 2028.
    • Original material. Mia, Liam, Priya, Noah, Fatima, Jonas, the school library, the shop, the news website and the cookie code A7Q3 are fictional. The domain names (example.org, example.com) and the addresses 203.0.113.x and 198.51.100.x are reserved for examples in documents, so they never belong to a real website or device.
    • Simplified on purpose. Real lookups often involve a chain of DNS servers and stored copies of answers, and a browser or router may remember recent answers. A real basket may be held entirely in the server or partly in the cookie. The lesson shows one common design. The law on cookies is summarised for the UK and varies elsewhere. Browsers and websites also use other ways to recognise a visitor, which are not taught.