CS331 · Annotated SlidesChapter 10 — Application Layer: DNS
Chapter 10 · Annotated slides

Application Layer: DNS

The Domain Name System: why names, the hierarchical name space and its labels, domains, FQDN vs. PQDN, name servers (root, primary, secondary, zone transfer, caching), and recursive vs. iterative resolution, traced step by step for lab.CS.PSU.EDU.SA looking up sales.mcgraw.com. Rebuilt from the highlighted copy of the deck until a clean one is uploaded.

Slide text Study notes Highlight: key words Tips, tricks & traps Seen again elsewhere How it can come up

Application Layer

CS331: Computer Networks · Chapter 10: DNS
1
Exam weight Low
  1. Why DNS → name space and labels → domains, FQDN/PQDN → name servers → recursive vs. iterative resolution.

Domain Name System

  • What is DNS?
    • Internet Directory Service
    • A client-server application that maps host names into their corresponding IP addresses①
    • Mapping host names into their corresponding IP addresses is called name resolution or name translation or name mapping or Address Resolution
  • Why we need to use names instead of IP numbers?
    • IP addresses are difficult to remember②
  • Problem: Network only understands numeric addresses
  • Solution:
    • Use alphanumeric names to refer to hosts
    • Add a distributed hierarchical protocol (called DNS) to map between alphanumeric host names and IP addresses③
2
Exam weight High
  1. DNS = the Internet’s directory: a client-server app that maps host NAMES → IP addresses (name resolution).
  2. People remember names; the network only understands numbers.
🎯 How this can come up · 2 questions
MCQ

Mapping a host name to its IP address is called:

True / False

DNS is a client-server application.

Name Space

  • IP addresses are unique 🡺 Host names must be unique
  • How to manage this large number of names?
  • Solution:
  • Each name is made of several parts (hierarchical). Each part is called a label①
  • Names are defined on tree structure with the root at the top
    • This is called hierarchical name space
  • Each node has a label
  • DNS requires that children of a node (nodes that branch from the same node) have different labels to guarantee uniqueness②
  • This will allow the control of names assignment to be decentralized
    • A central authority IANA assigns the part of the name that defines the nature of the organization (com, net, SA, CA, ...) and its name (IEEE, CNN, McGraw, Intel,...)
    • The rest of the name is managed by the local organization (CIS, Eng, sales, ...)③
3
Exam weight Medium
  1. Names are hierarchical: labels on a tree with the root at the top.
  2. Siblings must have different labels → every full name is unique.
  3. IANA controls the top parts (com, sa, …); each organisation manages the rest → decentralized.
🎯 How this can come up · 1 question
MCQ

Children of the same node in the DNS tree must:

Table 10.12 Generic domain labels

  • aero: airlines and aerospace · biz: businesses or firms · com: commercial organizations · coop: cooperative organizations
  • edu: educational institutions · gov: government institutions · info: information service providers
  • int: international organizations · mil: military groups · museum: museums · name: personal names (individuals)
  • net: network support centers · org: nonprofit organizations · pro: professional organizations
4
Exam weight Medium
  1. Generic top-level domains; country domains (sa, us, jp…) are the other kind.
🎯 How this can come up · 1 question
MCQ

The generic label for nonprofit organizations is:

The DNS Name Space

The Internet is divided into more than 200 top-level domains① Domain: It is subtree of the domain name space and consists of group of hosts that are under the administrative control of a single entity such as a company or a government agency.②

Each domain is subdivided into subdomains The leaves represent domains that have no subdomains A leaf domain may contain a single host, or represent a company with thousands of hosts③

A portion of the domain name space: generic domains (com, edu, gov, mil, org, net…) and country domains (jp, us, nl, SA…)
5
Exam weight Low
  1. Domain = a subtree under ONE administrative authority. Leaves have no subdomains (a host or a whole company).

Domains (Figure 10.38)

  • Domain is a subtree of domain name space
  • Domain is divided into sub-domains
  • Domain name is the domain name of the node at the top of the subtree
Domains are subtrees of the name space: com, edu and smaller domains inside them
6
Exam weight Low
  1. A domain’s name is the name of the node at the top of its subtree.

Domain names and labels

  • Each tree node has a domain name
  • A domain name is a sequence of labels separated by dots (.)
  • Labels are read from the node up to the root①

Example: aComputer.bDept.topUniversity.edu.②

Labels edu, topUniversity, bDept, aComputer up to the root (dot) build the name aComputer.bDept.topUniversity.edu.
7
Exam weight Medium
  1. Read from the leaf UP: aComputer → bDept → topUniversity → edu → root (the final dot).
🎯 How this can come up · 1 question
MCQ

In the name sales.mcgraw.com., the top-level domain is:

FQDN and PQDN

  • FQDN = fully qualified domain name: the full name ending with a dot (challenger.atc.fhda.edu.)①
  • PQDN = partially qualified domain name: a name to be completed (cs.hmme, www)②
  • Only an FQDN can be translated (mapped into its IP address)
  • PQDNs refer to a name in the same site; the remaining part (suffix) is completed by the DNS client program (resolver)③
FQDN examples ending with a dot; PQDN examples without the full suffix
8
Exam weight High
  1. FQDN = complete, ends with a dot, can be resolved. PQDN = partial; the resolver adds the local suffix.
Memory trickFully qualified = goes all the way to the root (the final dot).
🎯 How this can come up · 2 questions
MCQ

Which name can be mapped directly to an IP address?

True / False

A PQDN is completed by the resolver on the client.

Distribution of Name Spaces

  • The information contained in the domain name space must be stored.
  • Where ?
    • Centralized? inefficient & unreliable why?
      • Heavy traffic because of requests from all over the world
      • Failure makes data not available
      • Hard to maintain①
    • DNS is a distributed database system
      • Uses a large number of computers called name servers
      • Organized in a hierarchical way and distributed all over the world②
      • No single host has all the exact mappings for all the hosts in the Internet③
9
Exam weight High
  1. One central DNS server would be overloaded, a single point of failure, and hard to maintain.
  2. So DNS is a DISTRIBUTED database of hierarchical name servers.
🎯 How this can come up · 1 question
Written

Why isn’t the DNS database stored on one central server?

Hierarchy of name servers

Root server above edu, com and us servers, which sit above fhda.edu, bk.edu, mcgraw.com and irwin.com
10
Exam weight Low
  1. Each server knows about all the names below it.

Note: primary and secondary servers

A primary server loads all information

from the disk file; the secondary server

loads all information from

the primary server.

When the secondary downloads

information from the primary, it is called

zone transfer.①

11
Exam weight High
  1. Primary: loads its data from its own disk file. Secondary: copies it from the primary → zone transfer.
🎯 How this can come up · 1 question
MCQ

A secondary DNS server downloading data from the primary is called:

Root servers

  • Root server: a server which has references for the top level domains①
  • 13 root servers distributed all over the world②
Map of DNS root servers in North America and Europe
12
Exam weight Medium
  1. Root servers point to the top-level-domain servers. There are 13 (named A–M).
🎯 How this can come up · 1 question
MCQ

How many root servers are there in the slides?

DNS Caching

Each time a server receives a query for a name that is not in its domain, it needs to search its database for a server IP address. Reduction of this search time would increase efficiency. DNS handles this with a mechanism called caching.①

13
Exam weight Low
  1. Caching: servers remember recent answers so the next lookup skips the search.

Purpose of DNS

A file transfer client passes the host name to the DNS client, which queries the DNS server and returns the IP address
14
Exam weight Low
  1. App gives the name to the DNS client (resolver) → query → response → IP address back to the app.

Name resolution

  • DNS is a client-server application
    • Client part is called name resolver
    • Server part is called Name server① (its host name starts with the label DNS)
  • Steps of resolver operations:
    • A resolver receives a request from application layer (for example http) in the form of a system call, and
    • Returns the desired information in a form compatible with the local host’s data formats.②
  • Two techniques to map the host name to its IP address
  1. Recursive resolution:
    • Host A queries the site local name server B
    • If B has the answer in its cache or in its database, it returns it to A, otherwise it send requests to one of the root name servers
    • The root name server (if it does not have the answer in its cache or in its database) sends request to another name server in the next level of the tree say (C)
    • The process is repeated until an answer is obtained
    • Then, the answer will be transmitted back until it finally reaches the requesting host (A)③
    • See the next example
15
Exam weight High
  1. Client part = resolver. Server part = name server.
  2. Recursive: each server that doesn’t know asks the NEXT server itself, and the answer travels back down the same chain.

Recursive resolution: example

The source lab.CS.PSU.EDU.SA looks up the web server Sales.mcgraw.com.

Steps 1–4 go from the host through DNS.PSU.EDU.SA and the root to DNS.com and DNS.mcgraw.com; steps 5–8 return the answer the same way
16
Exam weight Low
  1. 1–4: the query is passed along from server to server. 5–8: the answer comes back along the same chain.

1- Recursive resolution – Example (cont’d.)

In the previous example, the mapping will be done as follows:

  1. Host lab.CS.PSU.EDU.SA contacts the local name server (DNS.PSU.EDU.SA) to query for the IP address of web server sales.McGraw.com
  2. If (DNS.PSU.EDU.SA) does not have the answer in its cache or in its database, it will contact the root name server to query for the IP address of web server sales.McGraw.com
  3. If the root name server does not have the answer in its cache or in its database, it will contact the name server responsible for the .com domain (DNS.com) to query for the IP address of web server sales.McGraw.com
  4. If (DNS.com) does not have the answer in its cache or in its database, it will contact (DNS.McGraw.com) which has the IP address for web server (Sales.McGraw.com)
  5. (DNS.McGraw.com) will return the answer to (DNS.com)
  6. (DNS.com) will return the answer to the root name server
  7. The root name server will return the answer to (DNS.PSU.EDU.SA)
  8. DNS.PSU.EDU.SA will return the answer to Host lab.CS.PSU.EDU.SA
17
Exam weight High
  1. Each server in the chain asks the next one on the host’s behalf.
🎯 How this can come up · 1 question
Scenario

In RECURSIVE resolution for sales.mcgraw.com from lab.CS.PSU.EDU.SA, who contacts DNS.com?

2- Iterative resolution (mapping)

  • Host A sends a query to local name server B
  • If B has the answer in its cache or in its database, it returns it to A, otherwise it send

requests to one of the root name servers①

  • The root name server (if it does not have the answer in its cache or in its database) sends a reply to B that contains the IP address of name server in the next level of the

tree say (C)②

  • Local name server B then sends a query directly to name server C
  • The process is repeated until local name server B received the IP address for the requested mapping③
  • Local name server B then sends the answer to Host A④
  • SEE the next example
18
Exam weight High
  1. Iterative: a server that doesn’t know REPLIES with the address of the next server, and the LOCAL server does all the asking itself.
Memory trickRecursive = “I’ll find out for you.” Iterative = “Ask him instead.”
Exam trapIn iterative resolution the root never contacts DNS.com; it only tells the local server where DNS.com is.
🎯 How this can come up · 2 questions
MCQ

In iterative resolution, the root server answers the local server with:

Written

Compare recursive and iterative DNS resolution.

Iterative resolution: example

The source lab.CS.PSU.EDU.SA looks up the web server Sales.mcgraw.com.

The local server DNS.PSU.EDU.SA queries the root (2–3), then DNS.com (4–5), then DNS.mcgraw.com (6–7), then answers the host (8)
19
Exam weight Low
  1. All the arrows start or end at the LOCAL server DNS.PSU.EDU.SA.

2- Iterative resolution – Example (cont’d.)

In the previous example, the mapping will be done as follows: 1- Host lab.CS.PSU.EDU.SA contacts the local name server (DNS.PSU.EDU.SA) to query

for the IP address of web server sales.McGraw.com

  1. If (DNS.PSU.EDU.SA) does not have the answer in its cache or in its database, it will contact the root name server to query for the IP address of web server sales.McGraw.com
  2. If the root name server does not have the answer in its cache or in its database, it will reply to the local name server (DNS.PSU.EDU.SA) with the IP address of the name server for the (.com) domain which is (DNS.com)
  3. The local name server (DNS.PSU.EDU.SA) will contact the name server (DNS.com) to query for the IP address of web server sales.McGraw.com
  4. If (DNS.com) does not have the answer in its cache or in its database, it will reply to the local name server (DNS.PSU.EDU.SA) with the IP address of the name server DNS.McGraw.com which is the local name server for domain McGraw.com
  5. The local name server (DNS.PSU.EDU.SA) will contact the name server (DNS.McGraw.com) to query for the IP address of web server sales.McGraw.com
  6. Since name server DNS.McGraw.com is the local name server for McGraw.com domain it will reply to the local name server (DNS.PSU.EDU.SA) with the IP address for web server sales.McGraw.com
  7. The local name server (DNS.PSU.EDU.SA) will reply to Host lab.CS.PSU.EDU.SA with the IP address for web server sales.McGraw.com
20
Exam weight High
  1. Count: the local server sends three queries (root, DNS.com, DNS.McGraw.com).
🎯 How this can come up · 1 question
MCQ

In the iterative example, which server sends the query to DNS.McGraw.com?

Note: DNS ports

DNS can use the services of UDP or TCP

using the well-known port 53.

21
Exam weight High
  1. DNS uses UDP or TCP on well-known port 53 (UDP for normal queries).
🎯 How this can come up · 1 question
MCQ

DNS uses well-known port: