Explain how a Uniform Resource Locator (URL) is used to locate a resource on the World Wide Web (WWW) and the role of the Domain Name Service (DNS)

Published by Patrick Mutisya · 14 days ago

Cambridge A-Level Computer Science 9618 – Networks: URLs and DNS

2.1 Networks – The Internet

Objective

Explain how a Uniform Resource Locator (URL) is used to locate a resource on the World Wide Web (WWW) and describe the role of the Domain Name Service (DNS).

What is a URL?

A Uniform Resource Locator (URL) is a textual address that tells a web client (e.g., a browser) how to retrieve a specific resource from the Internet.

Components of a URL

ComponentPurposeExample
SchemeIdentifies the protocol to be used (e.g., http, https, ftp).https
AuthorityContains optional user information, the domain name, and optional port number.www.example.com:443
PathSpecifies the hierarchical location of the resource on the server./articles/ai/introduction.html
QueryProvides a string of key‑value pairs that give additional parameters to the server.?id=42&lang=en
FragmentIdentifies a secondary resource within the primary resource, such as a section of a page.#section2

How a URL Locates a Resource

  1. Parsing the URL – The browser separates the scheme, authority, path, query and fragment.
  2. Scheme handling – Determines which protocol handler to invoke (e.g., HTTP client for http/https).
  3. Domain name resolution – The host part of the authority (e.g., www.example.com) is sent to the DNS system to obtain an IP address.
  4. TCP/IP connection – Using the IP address (and optional port), the browser establishes a TCP connection to the server.
  5. HTTP request – The client sends an HTTP request line that includes the path and query string.
  6. Server response – The server returns the requested resource (HTML, image, etc.) or an error code.
  7. Fragment handling – If a fragment identifier is present, the browser scrolls to the indicated part of the document.

Role of the Domain Name Service (DNS)

DNS is a distributed hierarchical database that translates human‑readable domain names into machine‑readable IP addresses.

  • Namespace hierarchy – Root → Top‑Level Domains (TLDs) → Second‑level domains → Sub‑domains.
  • Resolver process – The client’s resolver library queries a local cache, then the configured recursive resolver, which contacts authoritative name servers as needed.
  • Record types – Common DNS records used for web access:

    • A – IPv4 address.
    • AAAA – IPv6 address.
    • CNAME – Canonical name (alias).
    • MX – Mail exchange (not directly used for HTTP but part of the DNS ecosystem).

  • TTL (Time‑to‑Live) – Determines how long a DNS response may be cached before a fresh query is required.

Example: Resolving https://www.example.com/articles/ai/introduction.html?lang=en#overview

  1. Browser parses the URL:

    • Scheme: https
    • Authority: www.example.com
    • Path: /articles/ai/introduction.html
    • Query: lang=en
    • Fragment: #overview

  2. Resolver asks the recursive DNS server for the A record of www.example.com.
  3. Recursive server contacts the root server → TLD server for .com → authoritative server for example.com, which returns 93.184.216.34.
  4. Browser opens a TCP connection to 93.184.216.34 on port 443 (default for HTTPS).
  5. HTTPS handshake establishes an encrypted channel.
  6. Browser sends an HTTP GET request:

    GET /articles/ai/introduction.html?lang=en HTTP/1.1

    Host: www.example.com

  7. Server returns the HTML document; the browser renders it and scrolls to the element with id overview.

Key Points to Remember

  • A URL tells the browser what to request and how to request it.
  • DNS bridges the gap between human‑friendly domain names and the numeric IP addresses required for routing.
  • Caching (both in the browser and DNS) speeds up repeated accesses but can cause stale data if TTLs are too long.
  • Security extensions such as DNSSEC add authenticity to DNS responses, reducing the risk of spoofing.

Suggested diagram: Flowchart showing the steps from entering a URL in a browser to receiving the requested resource, highlighting the DNS lookup stage.