📘 CodingMarble Learn

Web Services: What Happens When You Open a Website

The World Wide Web (WWW) is a system of linked web pages that live on the Internet and are reached with a browser. Web pages are written in HTML, which uses fixed tags to show content; XML uses tags you make yourself to store and carry data. Every website has a domain name, like example.org, which DNS turns into an IP address. A URL is the full address of one resource: protocol, domain and path. A website is a set of related web pages. A web browser asks for pages and shows them; a web server stores them and sends them; web hosting is renting space on such a server so your site is online all the time.

🎬 Step-by-step story

  1. You type a URL in the browser. The URL has parts: https:// (protocol), www.example.org (domain name), /class12/notes.html (path to the file).
  2. The browser asks DNS, the Internet's phone book, to turn the domain name into an IP address like 93.184.216.34.
  3. The browser sends an HTTP(S) request to the web server at that IP. The server is a computer that stores the website's files.
  4. The server sends back the HTML file. HTML tags like <h1> and <p> tell the browser how to show the page. XML, by contrast, uses your own tags to carry data.
  5. A website is many linked pages. Web hosting means renting space on a server so your site stays online day and night.
  6. Your turn: build a URL from its parts and follow its trip from browser to DNS to server and back.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Is the Internet the same as the Web?

No. The Internet is the network of connected computers. The Web is the collection of linked pages that travels over it.

Why do we need DNS if we have IP addresses?

Routers use IP numbers, but people remember names. DNS looks up the number for the name, like a phone book.

Where is a website actually stored?

On a web server, a computer that is always on and connected. Your browser downloads a copy of the page from it.

Is XML a newer version of HTML?

No. HTML shows data on a page. XML is for storing and moving data with your own tags.

Why can't I just host my site on my laptop?

It would be offline when the laptop is off and has no fixed public address. Hosting keeps it on a server 24×7.

World Wide Web (WWW)

The World Wide Web is a huge collection of web pages linked to each other by hyperlinks, stored on computers all over the Internet. It was invented by Tim Berners-Lee in 1989–91 at CERN.

The Internet is the network (roads and wires); the Web is one service that runs on it (like shops along the roads). Email and VoIP are other services on the same Internet.

The Web rests on three ideas: HTML (the page language), URL (the address of each page) and HTTP (the rules for asking and sending pages).

HTML and XML

HTML (HyperText Markup Language) describes how a page should be displayed. It uses a fixed set of tags in angle brackets, like <h1>, <p>, <img>, <a href="…">.

<html>
  <body>
    <h1>My School</h1>
    <p>Welcome!</p>
  </body>
</html>

XML (eXtensible Markup Language) is used to store and carry data. You make your own tags, and every tag must be closed.

<student>
  <roll>7</roll>
  <name>Asha</name>
</student>
HTMLXML
Displays dataStores and carries data
Tags are fixed (predefined)You define your own tags
Not case-sensitive; some tags need no closingCase-sensitive; every tag must close
Mistakes are often ignored by browsersMust be well-formed or it fails

Domain names and DNS

IP addresses are hard to remember, so websites get a domain name, a readable name like ncert.nic.in or wikipedia.org.

The Domain Name System (DNS) is a worldwide set of servers that turns a domain name into an IP address, like a phone book turns a name into a number. This is called name resolution.

URL: Uniform Resource Locator

A URL is the complete address of one resource (page, image, file) on the Web.

https://www.example.org/class12/notes.html

An absolute URL has all parts. A relative URL such as notes.html or ../images/logo.png is used inside a site and is understood from the current page's location.

A domain name is only one part of a URL.

Website, web page, web browser, web server

Web hosting

Web hosting is a service that stores your website's files on a web server connected to the Internet 24×7, so anyone can open it. You pay a hosting provider for space, speed and security.

Steps to put a website online:

  1. Make the pages (HTML, images, etc.).
  2. Buy (register) a domain name from a registrar.
  3. Buy hosting space on a web server.
  4. Upload the files (often with FTP).
  5. Point the domain name to the server's IP address in DNS.

Types include shared hosting (many sites on one server, cheap), dedicated hosting (a whole server for one site) and cloud hosting (spread over many servers).

Try it: take a URL apart

Open any three websites you use. For each, copy the URL from the address bar and split it into protocol, domain name and path. Name the TLD and say whether it is generic or a country code. Then right-click a page and choose "View page source": you are looking at the HTML the web server sent. Use the free-play step in the 3D to build a URL and watch its trip.

Key formulas and definitions

Worked examples

1. Split https://www.cbse.gov.in/results/index.html into its parts.

Protocol: https. Domain name: www.cbse.gov.in (TLD .in). Path: /results/index.html (folder results, file index.html).

2. Which is generic and which is country-code: .org, .in, .edu, .jp, .gov?

Generic: .org, .edu, .gov. Country code: .in (India), .jp (Japan).

3. Write XML for a book with title 'Python Basics' and price 350.

<book> <title>Python Basics</title> <price>350</price> </book> — the tags are made up by us, and every tag is closed.

4. Put in order what happens when you open a website: server sends HTML, browser shows page, DNS finds IP, you type URL, browser sends HTTP request.

Type URL → DNS finds IP → browser sends HTTP request → server sends HTML → browser shows page.

5. A student made a website on her laptop. Why can't her friends open it, and what does she need?

Her laptop is not a server that is always online with a fixed public address. She needs web hosting (space on a web server) and a domain name that points to it.

6. Is 'google.com' a URL or a domain name?

It is a domain name. A full URL also has the protocol (and maybe a path), like https://google.com/maps.

Common mistakes

Practice quiz

1. Which language uses fixed tags to display web pages?
2. DNS converts:
3. In https://abc.org/a.html, the path is:
4. Which of these is a web browser?
5. Renting space on a server to keep a website online is:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between HTML and XML?

HTML uses fixed tags to display data on web pages. XML uses tags you define to store and carry data, and it is strict about closing tags and case.

What are the parts of a URL?

Protocol (like https), domain name (like www.example.org) and path (like /notes/page.html).

What is web hosting?

A service that keeps your website's files on a web server that is online all the time, so anyone can open the site.

Where this is taught

CBSE (India)Class 12Computer Networks
CBSE (India)Class 12Introduction to Computer Networks
England (GCSE, A level)Year 134.9 Communication and networking
FranceSecondeThemes
FrancePremièreHuman–machine interaction on the Web
Russia11 классInformation technologies

Learn first

Learn next

Related lessons

All Computer Science lessons