Communication

Communication

URLs and the DNS

Networks including the internet AS Level 10 min read

On this page
  1. What you need to be able to do
  2. What a URL is
  3. The Domain Name Service (DNS)
  4. Case by case
  5. Mark-scheme focus
  6. Worked examples
  7. Summary
  8. Can I do this?
  9. Quiz

What you need to be able to do

Syllabus 2.1 Networks including the internet
  • 2.1Explain how a Uniform Resource Locator (URL) is used to locate a resource on the World Wide Web.
  • 2.1Explain the role of the Domain Name Service (DNS).

You need: IP addresses and the internet and the WWW. This is the last page of the chapter.

What a URL is

A URL (Uniform Resource Locator) is the text address of a resource on the WWW (a web page, image, file): it says which protocol to use, which server (domain name) holds it, and where on that server it is.

Example: https://www.cie.org.uk/qualifications/as-and-a-level/index.html

PartIn the exampleMeaning
Protocol (scheme)https://the rules for fetching it: HTTP, or HTTPS (encrypted)
Domain namewww.cie.org.ukthe name of the web server; read right to left: top-level domain (.uk), second-level (org / cie), subdomain / host (www)
Path / file name/qualifications/as-and-a-level/index.htmlthe folders and the file on that server

People remember names; routers need numbers. The domain name in a URL must be turned into the server's IP address before any packet can be sent: that is the job of the DNS.

The Domain Name Service (DNS)

The DNS is a system of servers (DNS servers) that store domain names with their matching IP addresses and return the IP address for a requested domain name (it resolves the name).
Browser: URL typedCheck browser cacheDNS server: look up domainIP address returnedRequest sent to web server's IPPage returned and rendered
From URL to web page.
  1. The user types a URL (or clicks a link). The browser checks its cache for that domain's IP address.
  2. The browser parses the URL, splitting it into its parts (protocol, domain name, path).
  3. If the IP address isn't cached, the browser sends the domain name to a DNS server (usually the ISP's) to find the IP address.
  4. The DNS server looks the name up in its database; if it doesn't have the entry, it passes the request on to another DNS server higher up the hierarchy, until one that knows replies.
  5. The DNS server returns the matching IP address to the browser (if no server knows the name, an error is returned and the page isn't found).
  6. The browser connects to the web server at that IP address and sends a request for the resource (the path in the URL), using HTTP / HTTPS.
  7. The web server sends the page back; the browser renders and displays it. The IP address is stored in the browser's cache for next time.
The DNS server does not send the web page, and the router does not look up domain names. DNS's only job here: name in, IP address out.

Case by case

1 Split a URL

Identify the protocol, domain name and path in https://notes.example.edu.pk/physics/forces.html

Askedthree partsKnowscheme :// domain / pathRoutesplit at :// and the first /

  1. Protocol: https
  2. Domain name: notes.example.edu.pk (top-level domain .pk)
  3. Path: /physics/forces.html

2 Second visit

A user visits the same site again an hour later. Why is the page found faster?

AskedreasonKnowthe IP was cachedRouteno DNS lookup needed

  1. The IP address is already in the browser's cache, so the browser can skip the DNS lookup and contact the web server straight away

3 DNS doesn't know

The user's DNS server has no record of a new domain. What happens?

Askedwhat happensKnowDNS servers form a hierarchyRoutepass the query on

  1. The DNS server passes the request to another DNS server (higher in the hierarchy)
  2. that server returns the IP address, which is passed back to the browser (and cached by the DNS server)
  3. if no DNS server knows the name, an error message is returned

4 Typing an IP address

What happens if a user types http://142.250.4.100 instead of a domain name?

Askedis DNS needed?Knowthe address is already numericRouteskip DNS

  1. No DNS lookup is needed: the browser already has the IP address and contacts that server directly

Mark-scheme focus

Explain how the web browser uses the URL to access the web page (4 marks)

9618/11/O/N/25 Q7Paper 1 · Theory fundamentalsPart (c)4 marksFull size
(c) A user types a Uniform Resource Locator (URL) into the address bar of a web browser to access a web page. Explain how the web browser uses the URL to access the web page. [4]
Credited
  • The browser checks its cache for the URL; parses the URL and splits it into its component parts B1
  • The browser finds the IP address for the domain name by querying a DNS server; receives the matching IP address B1
  • The browser creates a connection with the web server with the matching IP address; a request for the resource is sent to that web server B1
  • The browser renders and displays the result; the IP address is stored in the browser cache B1
Not credited
  • “The DNS sends the web page”
  • “The router finds the IP address”
  • Skipping the request to the web server
Why

The marks follow the order of events: cache → parse → DNS query → IP returned → connect / request → render.

From: 9618/11/O/N/25 Q7(c)

  • URL / DNS: less common in 2021-25 (once as 4 marks), but central to how the WWW works and a likely longer question.
  • Order matters: give the steps in sequence, each as a separate point.

Worked examples

Example 1 · The role of the DNS (Past-paper style, 3 marks) ★ Easy
Past-paper style3 marks

Explain the role of the Domain Name Service (DNS) when a user enters a URL into a web browser.

  1. [3]
1 Read it with me what is actually happening?

The DNS's job only: what it stores, what it receives, what it returns.

    2 What is it asking for? the target, part by part
    • Whole3 points3
    3 What do we know? everything the question gives us
      4 Plan the route work backwards from what we want
      FindKey ideaAlready have itWork out firstTrap
        5 Now solve it have a go on paper first, then open the worked solution
        1. DNS servers store domain names and their matching IP addresses B1
        2. The browser sends the domain name from the URL to a DNS server; if it isn't found, the request is passed to another DNS server B1
        3. The DNS server returns the IP address of the web server to the browser, which then requests the page from that IP address B1
        6 Check it does the answer make sense?

        None of the points has the DNS sending the page ✓.

        Example 2 · Parts of a URL (Past-paper style, 3 marks) ★ Easy
        Past-paper style3 marks

        A student opens the URL https://www.school.edu.pk/timetables/year12.pdf

        Identify the protocol, the domain name and the file path in this URL.

        1. [3]
        1 Read it with me what is actually happening?

        Split at “://” and at the first “/” after the domain.

          2 What is it asking for? the target, part by part
          • Whole3 parts3
          3 What do we know? everything the question gives us
            4 Plan the route work backwards from what we want
            FindKey ideaAlready have itWork out firstTrap
              5 Now solve it have a go on paper first, then open the worked solution
              1. Protocol: https B1
              2. Domain name: www.school.edu.pk B1
              3. Path: /timetables/year12.pdf B1
              6 Check it does the answer make sense?

              ✓

              Summary

              • URL = protocol + domain name + path: where a resource is on the WWW.
              • DNS = servers mapping domain names to IP addresses; queries are passed up the hierarchy if unknown.
              • Browser: cache → parse URL → DNS query → IP address → request to web server → render; IP cached.
              If you see…do this
              “how is the URL used”the steps in order, browser and DNS
              “role of DNS”stores names ↔ IPs, returns the IP (passes on if unknown)

              Can I do this?

              Anything unticked: revise that section first. All ticked: take the quiz.

              Quiz

              The multiple-choice and guided questions need JavaScript. The concept checks and exam practice below work without it.

              Concept checks

              Answer each one in your head first, then open it.

              1If a DNS server went down, could you still reach a site?Show answer

              Only if its IP address was already cached, or you typed the IP address directly; otherwise the name can't be resolved.

              2Why are DNS answers cached?Show answer

              So repeated visits don't need a lookup every time: faster pages and less load on DNS servers.

              Exam-style practice

              New questions, not used above. Do them on paper, then mark your work against the official mark scheme.

              Q1Past-paper style4 marks

              A user clicks a link to https://www.museum.org/exhibits/today.html

              1. (a)
                Identify the domain name in this URL.
                [1]
              2. (b)
                Describe how the DNS is used to locate the web server.
                [3]
              Show the mark scheme
              PartAnswer / workingMarksGuidance
              (a)www.museum.orgB1
              (b)The browser sends the domain name to a DNS serverB1
              The DNS server looks up the matching IP address (passing the request to another DNS server if it's not found)B1
              The IP address is returned to the browser, which uses it to contact the web serverB1
              Total: 4 marks

              Your progress on this note is saved when JavaScript is on.