The Web — DNS, URLs and HTML
What happens when I type an address into a browser?
- Break a URL into its parts
- Explain the DNS lookup process
- Recognise basic HTML tags
Overview
The Web is the biggest and most-used service on the Internet. Behind it are three simple ideas: URLs to name things, DNS to find them, and HTML to show them.
Anatomy of a URL
https://www.education.gov.pg/grade11/ict.html has a scheme (https), a hostname (www.education.gov.pg), a path (/grade11/ict.html). Some URLs add a port, a query string (?key=value) and a fragment (#section).
DNS lookup
When you type the URL, the browser asks a DNS resolver for the IP of that hostname. Resolver → root → .pg → gov.pg → education.gov.pg. It hands back an IP, and only then does the browser open a TCP connection.
HTML in one paragraph
HTML is the language of web pages. Tags like <h1>, <p>, <a> and <img> tell the browser what to show. CSS adds style, JavaScript adds behaviour. Right-click any page and choose 'View Source' — that's the HTML.
URL Dissection
- For three URLs of your choice, break each into scheme, hostname, path, query.
- Guess the country of each hostname from its top-level domain (.pg, .au, .com).
- What does DNS return?
Reveal answer
The IP address matching a hostname.
- In https://x.com/a?b=1, what is 'https'?
Reveal answer
The scheme.
- What language describes the structure of a web page?
Reveal answer
HTML.
Run 'nslookup www.education.gov.pg' in a terminal. Note the IP address you get back.