All subjects · Computer Science · WCP03 Advanced Principles of Computer Science

The Domain Name System (DNS)

Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science

People remember names like example.com; computers route by IP address. DNS is the internet's distributed directory that translates one into the other.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

What DNS does

The Domain Name System translates domain names into IP addresses. Domain names are hierarchical, read right to left: in www.example.co.uk, '.uk' is the top-level domain (TLD), 'co' is a second-level domain, 'example' is the registered name and 'www' is a host. A fully qualified domain name names one specific host.

How a lookup works

1. The browser checks its own cache, then the operating system's cache.

2. If not found, the request goes to a recursive resolver (usually run by the ISP).

3. The resolver asks a root name server, which replies with the address of the right TLD server (for example, for .uk).

4. The resolver asks the TLD server, which replies with the address of the domain's authoritative name server.

5. The authoritative server returns the IP address.

6. The resolver returns it to the browser and caches it for a set time (its TTL); the browser then connects to that IP address.

StepAsksGets back
1Local cacheMiss
2Recursive resolverTakes over the search
3Root serverAddress of the .uk TLD server
4TLD serverAddress of example.co.uk's authoritative server
5Authoritative serverIP address of www.example.co.uk

Benefits and drawbacks

Benefits: people use memorable names; a site can move to a new IP address without users noticing; the system is distributed and hierarchical, so no single server holds everything and it scales; caching makes repeat lookups fast and reduces load.

Drawbacks: if DNS fails, sites become unreachable by name; cached records may be out of date after a change; attacks such as DNS cache poisoning (planting false records to send users to fake sites) and denial of service against DNS servers; lookups add a small delay.

Worked example

Why does the second visit to a website usually load faster than the first?

  1. On the first visit, a full DNS lookup is needed: resolver, root, TLD, authoritative server.
  2. The result is cached by the browser, OS and resolver.
  3. On the second visit, the IP address comes straight from a cache, so no lookup through the hierarchy is needed.

Answer: Cached DNS results remove the lookup delay.

Key idea: DNS translates domain names to IP addresses. Lookup: cache, recursive resolver, root server, TLD server, authoritative server, IP returned and cached. Distributed and fast, but open to poisoning and outages.

Check yourself

  1. What is the main job of DNS?
    • Translating domain names into IP addresses
    • Routing packets between networks
    • Encrypting web traffic
    • Assigning MAC addresses
    Show answer

    Translating domain names into IP addresses. DNS is the internet's directory service.

  2. In www.shop.example.org, what is the top-level domain?
    • www
    • shop
    • .org
    • example
    Show answer

    .org. The TLD is the rightmost part.

  3. What does a root name server return to a resolver?
    • The address of the name server for the top-level domain
    • The IP address of the website
    • The web page itself
    • A digital certificate
    Show answer

    The address of the name server for the top-level domain. Root servers point the way down the hierarchy.

  4. Which server holds the definitive IP address record for a domain?
    • The root server
    • The user's router
    • The browser
    • Its authoritative name server
    Show answer

    Its authoritative name server. The authoritative server is the final source of truth.

  5. Why do resolvers cache DNS results?
    • To keep the records secret
    • To answer repeat requests quickly and reduce load on the DNS hierarchy
    • Because root servers forget records
    • To encrypt the IP address
    Show answer

    To answer repeat requests quickly and reduce load on the DNS hierarchy. Caching is a large part of why DNS scales.

  6. What is DNS cache poisoning?
    • Deleting a domain name
    • Overloading a web server with requests
    • Encrypting DNS queries
    • Inserting false records into a DNS cache so users are sent to the wrong IP address
    Show answer

    Inserting false records into a DNS cache so users are sent to the wrong IP address. Users typing the right name could land on a fake site.

  7. Why is DNS designed as a distributed hierarchy rather than one central list?
    • Domain names change every few seconds
    • No single server could handle every request, and a single server would be a single point of failure
    • IP addresses are secret
    • It makes lookups slower but cheaper
    Show answer

    No single server could handle every request, and a single server would be a single point of failure. Distribution gives scale and resilience.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.