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.
browser1 URL?→DNS server2 IP address→browser3 request→web server4 web page→browser
Worked examples
Domain name
IP address
www.example.com
203.0.113.10
www.example.org
203.0.113.25
shop.example.net
198.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.
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.
(1) URL. (2) DNS server. (3) IP address. (4) request.
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 name
IP address
www.example.com
203.0.113.50
shop.example.net
198.51.100.77
school.example.org
192.0.2.99
(a) 192.0.2.99. (b) The name is not in the list, so the DNS server asks a higher-level DNS server. If that cannot find it either, the browser shows a 404 error.
3
Trace the flowchart (a) with the input club.example.org and (b) with the input club.example.com.
(a) The first question is no, the second is yes, so the output is 198.51.100.6. (b) Both questions are no, so the output is 404 error.
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”.
A flowchart with: Start; INPUT ip; a decision “ip = 203.0.113.10?” with yes to OUTPUT www.example.com; no to a second decision “ip = 203.0.113.25?” with yes to OUTPUT www.example.org and no to OUTPUT not found; End.