← IGCSE Computer Science Paper 1

Domain name server (DNS)

Domain name server: stores a list of domain names with their matching IP addresses. Give it a domain name and it returns the IP address. Many DNS servers exist across the internet.

Understanding Domain name server (DNS) in IGCSE Computer Science Paper 1

What it does: The DNS is given a domain name and returns the matching IP address, which is what the lookup shows. The browser sends the domain name to the DNS. The DNS searches its list for it. There are many DNS servers across the internet. This spreads the work and keeps lookups quick and reliable. A DNS matches domain names with IP addresses. It does not deal with file names or page content.

Common mistakes: The DNS list is keyed by domain name, so you give it the domain name to get the IP address out. Looking up by the IP address finds nothing. It should be print(dns[name]). The directory has the domain name and IP address the wrong way round. A DNS stores each domain name as the key with its matching IP address as the value: {"b.org": "10.0.0.5"}.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 477–489) and word search (Modules 464–489).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does a domain name server (DNS) store?
A list of domain names with their matching IP addressesA copy of every web page on the internet
Matches
DNS("192.0.2.44") returns www.shop.com
↓
This is back to front: you give the DNS a domain name and it returns the IP address, not the other way round.
Applying
Meanings
Term
DNS
Meaning
Domain name server: stores a list of domain names with their matching IP addresses. Give it a domain name and it returns the IP address. Many DNS servers exist across the internet.
Practice
DNS SERVER LIST
Testing
Gaps
= Domain Name Server
Check Answer
Spots
2name = "a.com"
3print(dns["10.0.0.1"])

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Blobfish' badge — Pressure Handler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does a domain name server (DNS) store?
A. A copy of every web page on the internet
B. A list of domain names with their matching IP addresses ✓
A DNS holds a list that matches each domain name to its IP address. It does not store the web pages themselves; those are kept on web servers.
2. A DNS works like which everyday item?
A. A letter that carries a message to a friend
B. A phone directory that links names to numbers ✓
A DNS is a directory. You look up a name (domain name) and it gives you a number (IP address).
3. What goes INTO a DNS during a lookup?
A. A domain name such as www.example.com ✓
B. An IP address such as 93.184.216.34
The browser sends the domain name to the DNS. The DNS searches its list for it.
4. What does a DNS give BACK when it finds a match?
A. The IP address for that domain name ✓
B. The HTML code for the web page
The DNS returns the IP address. The browser then uses it to contact the web server, which sends the page.
5. How many DNS servers are there across the internet?
A. Many DNS servers ✓
B. Only one DNS server for the whole world
There are many DNS servers across the internet. This spreads the work and keeps lookups quick and reliable.

Match the Pairs

www.example.com -> 93.184.216.34 → A DNS record: a domain name matched with its IP address
DNS → Domain name server: stores domain names and their matching IP addresses
Domain name in, IP address out: the DNS server returns the IP address for a domain name → DNS("www.bbc.co.uk") returns 151.101.64.81
DNS works like a directory: look up a name to find the matching number → directory["www.school.org"] = "203.0.113.8"
DNS("192.0.2.44") returns www.shop.com → This is back to front: you give the DNS a domain name and it returns the IP address, not the other way round.
There is only one DNS server for the whole internet → Many DNS servers exist across the internet, not just one.

Key Term

DNS
Domain name server: stores a list of domain names with their matching IP addresses. Give it a domain name and it returns the IP address. Many DNS servers exist across the internet.

Fill in the Blanks

1. DNS = Domain Name Server
Hint: Type the three-letter abbreviation for this kind of server.
2. DNS list: domain name and IP address
Hint: Type what each domain name is matched with in the DNS list.
3. domain = "example.com" ip = DNSLOOKUP(domain)
Hint: Type the variable name that holds the name you give to the DNS server.
4. IF no answer from this DNS THEN ask another DNS server ENDIF
Hint: Type the word that shows many DNS servers exist, so a different one can be asked.
5. site = "bbc.co.uk" ip = DNSLOOKUP(site) OUTPUT ip
Hint: Type the keyword that displays the IP address the DNS server returned.

Spot the Error

Question 1
A dns = {"a.com": "10.0.0.1"}
B name = "a.com"
C print(dns["10.0.0.1"])
Line C — The DNS list is keyed by domain name, so you give it the domain name to get the IP address out. Looking up by the IP address finds nothing. It should be print(dns[name]).
Question 2
A dns = {"10.0.0.5": "b.org"}
B site = "b.org"
C print(dns[site])
Line A — The directory has the domain name and IP address the wrong way round. A DNS stores each domain name as the key with its matching IP address as the value: {"b.org": "10.0.0.5"}.
Question 3
A domain ← "shop.com"
B domain ← DNS_LOOKUP(ip)
C OUTPUT ip
Line B — The lookup goes the wrong way. You give the DNS the domain name and it returns the IP address, so the line should be ip ← DNS_LOOKUP(domain).
Question 4
A dns = {"x.com": "10.1.1.1"}
B ip = dns("x.com")
C print("IP:", ip)
Line B — The DNS list is a dictionary, so you look an entry up with square brackets, not round brackets. It should be ip = dns["x.com"].
Question 5
A dns1 = {"a.com": "10.0.0.1"}
B name = "a.com"
C if name in dns1:
D print(dns1["name"])
E else:
F print("ask another DNS server")
Line D — "name" in quotes is the text name, not the variable holding the domain name. The key to look up is the variable, so it should be print(dns1[name]). If the first DNS server lacks the domain, another DNS server is asked.

Student with a class code? Join your class →