← IGCSE Computer Science Paper 1

A DNS lookup step by step

The browser sends a domain name to a DNS server, which searches for it and returns the matching IP address. If it has no match, it passes the request to another DNS server.

Understanding A DNS lookup step by step in IGCSE Computer Science Paper 1

What it does: DNS servers do not store every domain, so an unknown name is passed on to another DNS server to keep searching. The browser only knows the domain name the user typed. It asks DNS to find the matching IP address. DNS only returns the IP address. The web page comes later from the web server. The IP address lets the browser send its request to the right web server. Without a matching entry the browser has nothing to connect to, so the search continues on another DNS server.

Common mistakes: The DNS server searches its records for the domain name, because that is what the browser sent. The IP address is the answer it returns. Line 3 should be FIND domain IN dns_records. The browser must send the domain name to a DNS server first, to get the IP address. A web server cannot be contacted until the IP address is known. Line 2 should be SEND request TO dns_server.

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 the browser send to the DNS server at the start of a DNS lookup?
The IP address of the web serverThe domain name, such as www.example.com
Matches
DNS server -> browser: www.example.com
↓
The DNS server returns the IP address to the browser, not the domain name. The browser already knows the domain name, so sending it back does not help.
Applying
Meanings
Term
DNS lookup
Meaning
The browser sends a domain name to a DNS server, which searches for it and returns the matching IP address. If it has no match, it passes the request to another DNS server.
Practice
domain ← "www.example.com"
Testing
Gaps
ip ← DNS.(domain)
Check Answer
Spots
2SEND domain TO dns_server
3FIND ip IN dns_records

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

The 'Penguin' badge — List Waddler, 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 the browser send to the DNS server at the start of a DNS lookup?
A. The domain name, such as www.example.com ✓
B. The IP address of the web server
The browser only knows the domain name the user typed. It asks DNS to find the matching IP address.
2. What does the DNS server return to the browser when it finds a match?
A. The full web page
B. The IP address that matches the domain name ✓
DNS only returns the IP address. The web page comes later from the web server.
3. How does a DNS server find the right entry for a domain name?
A. It searches its records for a matching domain name ✓
B. It guesses the IP address from the domain name
DNS looks up the domain name in its stored records and finds the matching entry. It never guesses.
4. A DNS server has no record for the domain name it was sent. What happens next?
A. It sends the browser a random IP address
B. It passes the request on to another DNS server ✓
If there is no match, the DNS server passes the request to another DNS server to keep searching.
5. Which order is correct for a DNS lookup?
A. Browser sends domain name, DNS searches, IP address returned ✓
B. DNS sends IP address, browser searches, domain name returned
The browser asks first. DNS searches its records and then returns the IP address to the browser.

Match the Pairs

DNS lookup → The browser sends a domain name to a DNS server, which searches for it and returns the matching IP address
www.example.com -> 93.184.216.34 → The DNS server found the domain name in its records and returned the matching IP address to the browser
If the first DNS server has no entry for the domain name, it passes the request on to another DNS server → if domain not found: ask another DNS server
The first step of a lookup is the browser sending the domain name to a DNS server → browser -> DNS server: www.example.com
DNS server -> browser: www.example.com → The DNS server returns the IP address to the browser, not the domain name. The browser already knows the domain name, so sending it back does not help.
Domain not found: browser uses the IP address anyway → If no match is found there is no IP address to use. The DNS server should pass the request to another DNS server instead.

Key Term

DNS lookup
The browser sends a domain name to a DNS server, which searches for it and returns the matching IP address. If it has no match, it passes the request to another DNS server.

Fill in the Blanks

1. domain ← "www.bbc.co.uk" ip ← DNS.SEARCH(domain)
Hint: Type the method name that makes the DNS server look for the domain name.
2. IF found THEN RETURN ip ENDIF
Hint: Type the keyword that sends the matching IP address back to the browser.
3. IF NOT found THEN PASS request TO otherDNS ENDIF
Hint: Type the keyword that reverses a condition, so this runs when no matching entry is found.
4. IF NOT found THEN PASS request TO otherDNS ENDIF
Hint: Type the keyword for handing the request on to another DNS server.
5. IF found THEN RETURN ip ELSE OUTPUT "Not found"
Hint: Type the keyword that starts the branch used when the domain is not found.

Spot the Error

Question 1
A domain ← "www.example.com"
B SEND domain TO dns_server
C FIND ip IN dns_records
D RETURN ip TO browser
Line C — The DNS server searches its records for the domain name, because that is what the browser sent. The IP address is the answer it returns. Line 3 should be FIND domain IN dns_records.
Question 2
A request ← domain_name
B SEND request TO web_server
C ip ← DNS_SEARCH(request)
D CONNECT TO ip
Line B — The browser must send the domain name to a DNS server first, to get the IP address. A web server cannot be contacted until the IP address is known. Line 2 should be SEND request TO dns_server.
Question 3
A domain ← "192.168.1.5"
B SEND domain TO dns_server
C ip ← dns_server.RESULT
D CONNECT TO ip
Line A — A DNS lookup starts with a domain name, which is what the user types. An IP address is the result of the lookup. Line 1 should store a domain name such as "bbc.co.uk".
Question 4
A SEARCH records FOR domain
B IF match found THEN
C RETURN ip TO browser
D ELSE RETURN ip TO browser
E ENDIF
Line D — If this DNS server has no matching record, it has no IP address to return. It must pass the request on to another DNS server. Line 4 should be ELSE PASS TO other_dns.
Question 5
A dns_server RECEIVES domain
B FIND matching web_page
C SEND ip_address TO browser
Line B — A DNS server matches a domain name to an IP address. It does not store or find web pages. Line 2 should be FIND matching ip_address.

Student with a class code? Join your class →