AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Addresses on the web

Week 13 · Unit 7.3: Connections are made · 3 lessons
3

How DNS finds a page

Computing 7: Unit 7.3, pp. 82–111
GoalPut the steps of a DNS look-up in order and trace a look-up flowchart.
New words
DNS · Domain Name System: it translates a domain name into an IP addressDNS server · a server with a big list of domain names and their IP addressesrequest · a message that asks for something, such as a web page404 error · the page-not-found message you see when the page or server cannot be found
Explanation

Browsers need an IP address, but people type URLs. DNS, the Domain Name System, translates a URL into an IP address. A DNS server keeps a big list of domain names and the IP addresses that match them. It works like a library catalogue: you look up a title and it tells you the shelf number. First you type a URL, and the browser sends a request to a DNS server. The DNS server looks in its list and sends the IP address back. The browser then asks the web server at that address for the page, and the web server sends the page. If the name is not in the list, the DNS server asks a higher-level DNS server, and if that fails too, you see an error such as 404, page not found.

Worked examples
Domain nameIP address
www.example.com203.0.113.10
www.example.org203.0.113.25
shop.example.net198.51.100.40
A look-up. This is a small part of a DNS server’s list. The browser asks for www.example.org, and the DNS server sends back 203.0.113.25.
A name that is not in the list. The browser asks for www.example.net. The first DNS server cannot find it, the higher-level DNS server cannot find it either, and the browser shows a 404 error.
StartINPUT urlurl = www.example.com?yesnoOUTPUT 203.0.113.10url = www.example.org?yesnoOUTPUT 203.0.113.25OUTPUT 404 errorEnd
The same idea as a flowchart. Input www.example.org: the first question is no, the second is yes, so the output is 203.0.113.25.
Class activity

Be the DNS server (no computer): you need four players and some paper. One player is the user, one is the browser, one is the DNS server and one is the web server. The DNS server holds a list of six made-up names with numbers, for example art.example.org and 198.51.100.5. The user hands the browser a name on paper. The browser asks the DNS server, who looks in the list and writes the number on a note. The browser then takes the note to the web server and brings back a “page” (a drawing). Sometimes the user asks for a name that is not in the list: then the DNS server says “404”. Swap roles and play again.

Practice
1
Complete each sentence with one of these words: IP address, request, URL, DNS server. (1) Sana types a ___ into her browser. (2) The browser asks a ___ to look up the name. (3) The ___ comes back to the browser. (4) The browser sends a ___ to the web server, and the page comes back.
2
Use the DNS list. (a) What IP address does the DNS server send for school.example.org? (b) The browser asks for school.example.com. What happens?
Domain nameIP address
www.example.com203.0.113.50
shop.example.net198.51.100.77
school.example.org192.0.2.99
3
Trace the flowchart (a) with the input club.example.org and (b) with the input club.example.com.
StartINPUT urlurl = club.example.net?yesnoOUTPUT 198.51.100.5url = club.example.org?yesnoOUTPUT 198.51.100.6OUTPUT 404 errorEnd
4
Draw a flowchart on paper that takes an IP address and outputs the domain name for two sites: 203.0.113.10 gives www.example.com and 203.0.113.25 gives www.example.org. Anything else gives “not found”.