Introduction To DNS
Introduction To DNS
Administration
Introduction to The Domain Name System (DNS)
Course Lecturer: Walu G. Gondwe, Computer Science and Information Technology
Department (CSIT), MUST
Email: wgondwe@must.ac.mw
People and Numbers
• Recall: Network devices are identified by (IP) addresses;
• IP is a heirachical numbering system adopted by the Internet
• E.g. ff you need to reach Amazon, you need their IP address
– Does anyone know Amazon's IP?
• Problem:
– People can’t remember IP addresses
– Need human readable names that map to IPs
• Possible solution:
– Build a (shared) database of name-to-IP mappings and let the people use
simple names e.g.
– This shared, distributed database is the Domain Name System
2
People and Numbers cont...
• Why Should We Learn About DNS? It is central to operation of
all web-based services
– Web and FTP servers use A records stored in DNS for name
resolution of URLs
– Email servers rely on MX records stored in DNS to resolve
email servers
– Some services use DNS records for security and identity
verification (e.g. TXT records)
3
Internet Names and Addresses
• Addresses, e.g. 41.70.81.100
– Computer usable labels for machines
– Conform to structure of the network
• Names, e.g. www.hec.ac.mw
– Human usable labels for machines
– Conform to organizational structure
• How do you map from one to the other?
– Domain Name System (DNS)
4
Towards DNS
• Eventually, the hosts.txt system fell apart
– Not scalable, global admin couldn’t handle the
load
– Hard to enforce uniqueness of names
• e.g MIT
– Massachusetts Institute of Technology or
Malawi Institute of Technology?
– Many machines had inaccurate and outdate copies
of hosts.txt
• Thus, DNS was born
5
Brief History of Naming
• Before DNS, all mappings were in hosts.txt
– /etc/hosts on Linux
– C:\Windows\System32\drivers\etc\hosts on
Windows
• This was a centralized, manual system (small Internet):
– Changes were submitted by individuals and organizations
to a central (global) administrator via email
– Machines periodically downloaded new copies of
hosts.txt
– Administrators could pick names at their discretion
– Any name was allowed e.g.
this_is_my_home_desk_computer_1
6
DNS at a High-Level
• It is a distributed database i.e. parts are maintained
by separate devices (no centralization)
• Simple client/server architecture
– Uses UDP port 53, some implementations also
use TCP (Why?)
• Hierarchical namespace
– As opposed to original, flat namespace
– e.g. .com -> amazon.com -> aws.amazon.com
7
Naming Hierarchy
Root
10
Root Name Servers
• Responsible for the Root Zone File
– Lists the TLDs and who controls them
– ~272KB in size
• Administered by ICANN
– 13 root servers, labeled A to M
– 6 are anycasted, i.e. they are globally replicated
• Contacted when names cannot be resolved
– In practice, most systems cache this information
11
Map of the Roots
12
Basic Domain Name Resolution
• Every host knows at least 1 local DNS server (configured)
– Clients send all queries to the local DNS server
• If the local DNS can answer the query, then you’re done. This
happens if:
1. Local server is also the authoritative server for that name OR
2. Local server has cached the record for that name
• Otherwise, go to root and down the hierarchy and search for the
authoritative name server:
– Every local DNS server knows the root servers
– Use cache to skip steps if possible
• e.g. skip the root and go directly to .edu if the root file is
cached
13
Recursive DNS Query
DNS Resource Records
• DNS queries have two fields: name and
type
• Resource record is the response to a query
– Four fields: (name, value, type, TTL)
– There may be multiple records returned for
one query
• What do the name and value mean?
– Depends on the type of query and response
15
DNS Entry Types
• Type = A / AAAA Name: www.ccs.neu.edu
Query
– Name = domain name Type: A
– Value = IP address
Name: www.ccs.neu.edu
Resp.
– A is IPv4, AAAA is IPv6
Value: 129.10.116.81
• Type = NS
– Name = partial domain
Query Name: ccs.neu.edu
– Value = name of DNS
Type: NS
server for this domain
– “Go send your query to this Name: ccs.neu.edu
Resp.
Query
– Name = hostname Type: CNAME
– Value = canonical hostname
Name: foo.mysite.com
Resp.
– Useful for aliasing
– CDNs use this Value: bar.mysite.com
• Type = MX
– Name = domain in email Name: ccs.neu.edu
address Query
Type: MX
– Value = canonical name of
mail server Name: ccs.neu.edu
Resp.
Value: amber.ccs.neu.edu
17
Reverse Lookups
ccs.neu.edu
18