A-Level Computer Science / Unit 2: Networks, Connectivity and the Internet

2.1.11 URLs, Domain Names and DNS

πŸ”’ Lesson slides are available to signed-in users. Sign in

2.1.11 URLs, Domain Names and DNS

People use readable web addresses, but Internet communication ultimately depends on numerical IP addresses. A Uniform Resource Locator (URL) identifies a particular resource, while the Domain Name System (DNS) helps find the IP address associated with the host named in that URL.

This section follows the complete process from entering a URL to requesting the chosen resource from a web server.

By the end of this section, you should be able to:

  • explain how a URL identifies a resource on the World Wide Web;
  • identify the main components of a URL;
  • distinguish a URL, domain name and IP address;
  • explain the hierarchical structure of a domain name;
  • describe DNS as a distributed hierarchical naming system;
  • explain the roles of recursive, root, top-level-domain and authoritative DNS servers;
  • trace the process of resolving a domain name and requesting a web resource;
  • explain the purpose and limitations of DNS caching.

How a URL locates a web resource

Uniform Resource Locator (URL): a structured address that identifies how and where a resource should be requested.

A URL does more than name a website. It can identify:

  • the protocol or scheme to use;
  • the host that provides the resource;
  • the path to a particular page, file or service;
  • optional parameters supplied to the server;
  • an optional location within the returned resource.

Original example

https://learn.orchard-labs.org:443/courses/networks/quiz?level=as#question-4

The browser interprets the URL, resolves the host name, connects to the appropriate server and requests the resource named by the path and query.

Common mistake

A URL is not simply another name for a domain. The domain identifies the host; the complete URL can also specify the protocol, path, query and fragment.

Anatomy of a URL

Component Example Purpose
Scheme https States the communication method the browser should use.
Host name learn.orchard-labs.org Names the host whose address must be found.
Port 443 Optionally identifies the destination service; standard ports are often omitted.
Path /courses/networks/quiz Identifies the required resource or application route on the server.
Query string ?level=as Supplies additional values to the server-side resource.
Fragment #question-4 Identifies a position or section within the returned resource; it is normally handled by the browser.

URL component explorer

Scheme: why does it matter?

The scheme tells the browser which rules to use. HTTPS indicates protected HTTP communication, while another scheme may identify a different type of service.

Host: what does DNS resolve?

DNS resolves the host name, such as learn.orchard-labs.org. DNS does not normally resolve the path, query or fragment.

Path: what happens after the connection?

Once the browser has reached the server, it requests the resource indicated by the path. Different paths can lead to different resources on the same host.

Fragment: is it sent to DNS?

No. DNS is concerned with the host name. A fragment is normally used locally by the browser after the resource has been returned.

Exam tip

For a URL question, state both ideas: the host name identifies the server, while the path identifies the required resource on that server.

Domain names and their hierarchy

Domain name: a readable hierarchical name used to identify an Internet host or domain.

Domain names are read from the most general part on the right to increasingly specific labels on the left.

Example

learn.orchard-labs.org

Label Role in this example
org Top-level domain
orchard-labs Registered second-level domain
learn Subdomain or host label

Top-level domains include generic forms such as .org, .com and .edu, as well as country-code forms such as .cn, .it and .uk.

Common mistake

The leftmost label is not automatically the top-level domain. The top-level domain is the rightmost label, such as org in this example.

The role of DNS

Routers need IP addresses, not human-friendly domain names. DNS supplies the link between the two.

Domain Name System (DNS): a distributed hierarchical naming system that stores records and resolves domain names to information such as IP addresses.
Name resolution: the process of finding the required DNS information for a domain name.

What DNS doesβ€”and does not do

DNS does DNS does not
Find address records for host names. Download the requested web page.
Refer a resolver to other DNS servers. Choose the page path inside the website.
Cache answers for limited periods. Route every packet across the Internet.
Store several kinds of naming records. Replace the need for IP addressing.

Common mistake

DNS does not return the whole website. It returns naming information, commonly an IP address, so that the browser can contact the server separately.

How DNS is organised

DNS is distributed so that no single server must store and answer for every domain. Responsibility is divided across levels and administrative areas.

Component Role
Recursive resolver Receives a user's query, checks its cache and obtains the answer from other DNS servers when necessary.
Root server Directs the resolver towards the servers responsible for the relevant top-level domain.
Top-level-domain server Directs the resolver towards an authoritative server for the requested domain.
Authoritative server Stores the official records for a domain or DNS zone.
DNS zone An administratively managed portion of the DNS namespace.
Secondary authoritative server Maintains a transferred copy of zone data to improve resilience and availability.

Why distributed?

  • Responsibility can be delegated to the organisations that manage each domain.
  • Workload is shared across many servers.
  • Replicated authoritative data improve availability.
  • Local caching reduces repeated remote queries.

Common mistake

DNS is not one worldwide central database stored on a single root server. Root servers provide referrals into the hierarchy; authoritative servers hold the records for individual zones.

How name resolution works

Suppose the browser needs the IP address for learn.orchard-labs.org.

  1. The device checks relevant local information, such as its DNS cache.
  2. If no usable answer is available, the device asks its configured recursive resolver.
  3. The resolver checks its own cache.
  4. If necessary, it asks a root server where to find information for .org.
  5. The root server returns a referral to an appropriate .org server.
  6. The resolver asks the top-level-domain server where to find the authoritative server for orchard-labs.org.
  7. The top-level-domain server returns a referral to the authoritative server.
  8. The resolver asks the authoritative server for the address record of learn.orchard-labs.org.
  9. The resolver returns the answer to the user's device and may cache it.
  10. The browser can now connect to the returned IP address.

Referral versus final answer

Response Meaning
Referral Points the resolver towards another DNS server that is closer to the required authority.
Authoritative answer Comes from a server responsible for the relevant DNS zone.
Cached answer Comes from previously stored data that remain valid for their configured lifetime.

Exam tip

Use a clear chain: resolver β†’ root referral β†’ TLD referral β†’ authoritative answer β†’ IP returned.

DNS caching

A resolver does not need to repeat the complete hierarchy lookup for every request. It can temporarily store records it has already received.

DNS cache: temporary storage of recently obtained DNS information.
Time to live (TTL): the period for which a DNS record may be cached before it should be refreshed.
Benefit Limitation
Frequently requested names can be resolved more quickly. A changed record may not be seen until an older cached copy expires.
Fewer repeated queries reach root, TLD and authoritative servers. Incorrect or maliciously altered cache data can direct users to the wrong destination.
Network traffic and resolution workload are reduced. Short TTLs increase query frequency, while long TTLs delay propagation of changes.

Common mistake

A cached answer is not inherently incorrect. It is valid while its lifetime has not expired, but it may temporarily differ from a recently changed authoritative record.

From URL to returned resource

DNS is one stage of a larger process.

  1. The user enters a URL.
  2. The browser separates the scheme, host, port, path, query and fragment.
  3. The browser obtains an IP address for the host, using DNS when necessary.
  4. The device sends packets towards that IP address.
  5. A connection is established with the server and the required protocol is used.
  6. The browser sends a request containing the path and any query data.
  7. The server returns the requested web resource or an error response.
  8. The browser interprets the response and presents the page.
  9. If a fragment is present, the browser moves to the named section locally.
URL β†’ extract host β†’ DNS resolution β†’ IP address β†’ connect to server β†’ request path β†’ receive resource

Common mistake

DNS resolves the host name, not the complete URL. The web server handles the path and query after the browser has connected.

Interactive: DNS Name Resolution Visualiser

Choose one of the three outcomes, then watch how the lookup behaves. The visualiser uses portal.riverview.edu as the example domain.

portalsubdomain . riverviewdomain . edutop-level domain
Choose the outcome
Query sent First DNS server asked first Root server .edu server Authoritative server riverview.edu

Authoritative answer

    Practice

    Core understanding

    1. Explain how a URL is used to locate a resource on the World Wide Web.
    2. Distinguish a URL from a domain name and an IP address.
    3. Identify the scheme, host, path, query and fragment in:
      https://revision.blue-peak.net/tasks/binary?mode=practice#task-6
    4. Explain why DNS is described as both distributed and hierarchical.
    5. State the roles of root, TLD and authoritative DNS servers.
    6. Explain the difference between a referral and an authoritative answer.
    7. Explain one benefit and one limitation of DNS caching.

    Trace the process

    A learner enters: https://media.northshore.academy/recordings/networking/week-3

    1. Which part is sent for DNS resolution?
    2. Which part identifies the required server resource?
    3. Describe the DNS lookup if the resolver has no cached answer.
    4. Explain what the browser does after receiving the IP address.
    5. Would DNS need to resolve the name again immediately for a second request? Explain.

    Spot and correct the misconception

    1. β€œDNS downloads the web page and sends it to the browser.”
    2. β€œThe top-level domain is always the first word in a domain name.”
    3. β€œA URL and an IP address are the same thing.”
    4. β€œRoot servers store every website's IP address.”
    5. β€œA cached DNS answer is always wrong.”

    Review

    Concept Key idea
    URL A structured address identifying how and where to request a resource.
    Domain name A readable hierarchical name for a host or domain.
    DNS A distributed hierarchical system that resolves names to records such as IP addresses.
    Recursive resolver Obtains and returns an answer for the client.
    Root server Refers a resolver towards the relevant top-level domain.
    TLD server Refers a resolver towards the authoritative server for a domain.
    Authoritative server Stores official records for its DNS zone.
    Cache Temporarily stores answers to speed later resolution.

    Quick self-check

    1. Can I break a URL into its main parts?
    2. Can I explain which part DNS resolves?
    3. Can I describe the hierarchy without saying that root servers store every address?
    4. Can I trace a lookup from resolver to authoritative server?
    5. Can I explain why a cached record may remain temporarily after an authoritative change?
    6. Can I trace the complete journey from URL to returned web resource?