Professional Documents
Culture Documents
& Networks
CSNC-2413
Lec: 10
• Domain Name System (DNS) Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
Chapter 2: outline
2.1 Principles of network applications
2.2 Web and HTTP
2.3 FTP
2.4 Electronic mail
SMTP, POP3
2.5 DNS
2.6 P2P applications
2.7 Socket programming with UDP and TCP
2
DNS: domain name system
Internet hosts, routers: Domain Name System:
IP address (32 bit), distributed database:
used for addressing in implemented in hierarchy of
datagrams many name servers
hard to remember application-layer protocol:
“name”, allows hosts to query name
e.g, www.yahoo.com, servers to resolve names
used by humans (address/name translation)
Q: how to map between IP
Note
address and name, and
vice versa ? DNS protocol : UDP port 53
Used by applications e.g HTTP,
FTP,
3
DNS: resolving hostname
Example: When browser on a host requests a URL, the host
obtains IP address of destination using DNS:-
host runs client side of DNS application
browser gets hostname from URL and passes to DNS client
DNS client sends DNS Query for hostname to DNS Server
DNS client eventually receives DNS Reply, containing IP address
for the hostname
browser can now initiate TCP connection to HTTP server
6
Domain & Hostname
Hostname for a machine
named “challenger”
connected to domains
as shown
7
Distributed, Hierarchical Database
8
Distributed, Hierarchical Database
m. WIDE Tokyo
e. NASA Mt View, CA (5 other sites)
f. Internet Software C.
Palo Alto, CA (and 48 other sites)
10
TLD, Authoritative servers
Top-level domain (TLD) servers:
responsible for top-level domains, e.g, com, org, net, edu, gov;
and all country top-level domains, e.g, uk, fr, ca, jp
Network Solutions maintains TLD servers for com TLD
Educause for edu TLD
11
Local DNS name server
Does not strictly belong to DNS hierarchy; lies closest to host
Each ISP (residential ISP, company, university) has one
ISP provides host with IP address of local DNS server;
(typically thru DHCP)
also called “ default name server”
DNS query from host, sent to Local DNS server
has local cache of recent name-to-address translation pairs
(but may be out of date..!)
acts as proxy, forwards query into DNS hierarchy
provides DNS reply
12
DNS name root DNS server
resolution example
2 3
host at cis.poly.edu 7
6
wants IP address for TLD DNS
gaia.cs.umass.edu server
gaia.cs.umass.edu
13
DNS name root DNS server
resolution example
2
3
Iterated Query:
4
TLD DNS
contacted server replies server
5
with name of server to
contact local DNS server
dns.poly.edu
“I don’t know this name, 7 6
but ask this server” 1 8
14
DNS: caching, updating records
Once (any) name server learns mapping, it is cached
TLD servers typically cached in local name servers
thus Root name servers not often visited
cache entries timeout after some time (often 2 days)
DNS server having a cached entry can reply DNS query
even if not Authoritative for the hostname
Cached entries may be out-of-date...!
Update/notify mechanisms proposed in IETF standard
RFC 2136
15
DNS records
DNS servers store resource records (RR)
Each DNS Reply carries one/more RRs
Type=A Type=CNAME
name is hostname name is alias name for some
value is IP address “ canonical” name
www.ibm.com is really
Type=NS servereast.backup2.ibm.com
name is domain (e.g., value is canonical name
foo.com)
value is hostname of Type=MX
Authoritative name server for value is name of mailserver
this domain associated with name
16
DNS protocol, messages
Query & Reply messages, both with same message format
2 bytes 2 bytes
Msg header
identification flags
Identification:
# questions # answer RRs
16 bit # for query,
reply to query uses same # # authority RRs # additional RRs
query or reply
answers (variable # of RRs)
reply is Authoritative
recursion desired authority (variable # of RRs)
recursion available
additional info (variable # of RRs)
17
DNS protocol, messages
2 bytes 2 bytes
identification flags
Data Sections
# questions # answer RRs
18
Inserting records into DNS
Example: new startup “ Network Utopia”
Register domain name networkutopia.com at DNS Registrar
(e.g., Network Solutions)
provide names, IP addresses of Authoritative name server
(primary and secondary)
Registrar inserts two RRs into com TLD server:
(networkutopia.com, dns1.networkutopia.com, NS)
(dns1.networkutopia.com, 212.212.212.1, A)
Create following RRs in your Authoritative DNS servers
type A for web server, www.networkutopia.com
type MX for mail server, mail.networkutopia.com
19