0% found this document useful (0 votes)
80 views

Outline: DNS Design

This document provides an outline for a lecture on the Domain Name System (DNS). It discusses the goals of DNS which include scalability, decentralization, and robustness to allow global name resolution. It describes how DNS works as a distributed database that maps domain names to IP addresses. DNS uses a hierarchical structure with records like A records and name servers to look up names and route queries across networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Outline: DNS Design

This document provides an outline for a lecture on the Domain Name System (DNS). It discusses the goals of DNS which include scalability, decentralization, and robustness to allow global name resolution. It describes how DNS works as a distributed database that maps domain names to IP addresses. DNS uses a hierarchical structure with records like A records and name servers to look up names and route queries across networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

2/23/2008

Outline

15-441 Computer Networking


Lecture 13 – DNS
z DNS Design
Peter Steenkiste
Departments of Computer Science and
Electrical and Computer Engineering z DNS Today

15-441 Networking, Spring 2008


http://www.cs.cmu.edu/~dga/15-441/S08
1 2

Naming Obvious Solutions (1)

z How do we efficiently locate Why not centralize DNS?


resources? z Single point of failure
» DNS: name Æ IP address z Traffic volume
z Challenge z Distant centralized database
» How do we scale these to the wide area? z Single point of update
z Is this an application?
» Kind of z Does not scale!

3 4

Obvious Solutions (2) Domain Name System Goals

Why not use /etc/hosts, i.e. fully distributed? z Basically a wide-area distributed database
z Original Name to Address Mapping z Scalability
» Flat namespace z Decentralized maintenance
» /etc/hosts
z R b
Robustness
» SRI kept main copy
» Downloaded regularly z Global scope
z Count of hosts was increasing: machine per » Names mean the same thing everywhere
domain Æ machine per user z Do not need
» Many more downloads
» Atomicity
» Many more updates
» Strong consistency
z Does not scale! » Simplifies management
5 6

1
2/23/2008

Programmer’s View of DNS


DNS Message Format
z Conceptually, programmers can view the DNS
Identification Flags
database as a collection of millions of host entry
structures: 12 bytes No. of Questions No. of Answer RRs
/* DNS host entry structure */
struct hostent { No. of Authority RRs No. of Additional RRs
char *h_name; /* official domain name of host */
Name, type fields
char
h **h li
**h_aliases; /* null-terminated
ll t i t d array off domain
d i names */
for a query Questions (variable number of answers)
int h_addrtype; /* host address type (AF_INET) */
int h_length; /* length of an address, in bytes */
char **h_addr_list; /* null-terminated array of in_addr structs */ RRs in response
to query
Answers (variable number of resource records)
};

» in_addr is a struct consisting of 4-byte IP address Records for


Authority (variable number of resource records)
authoritative
z Functions for retrieving host entries from DNS: servers
» gethostbyname: query key is a DNS host name. Additional Additional Info (variable number of resource records)
“helpful info that
» gethostbyaddr: query key is an IP address. may be used
7 8

DNS Header Fields DNS Records


RR format: (class, name, value, type, ttl)
z Identification • DB contains tuples called resource records (RRs)
• Classes = Internet (IN), Chaosnet (CH), etc.
»Used to match up request/response • Each class defines value associated with type

z Flags
FOR IN class:
»1-bit to mark query or response
z Type=A • Type=CNAME
»1-bit to mark authoritative or not » name is hostname • name is an alias name for some
“canonical” (the real) name
»1-bit to request recursive resolution » value is IP address
• value is canonical name
z Type=NS
»1-bit to indicate support for » name is domain (e.g. foo.com)
• Type=MX
• value is hostname of mailserver
recursive resolution » value is name of authoritative associated with name
name server for this domain

9 10

Different Mappings are Possible DNS Design: Hierarchy


Definitions
z Simple case: 1-1 mapping between domain name and IP addr:
• Each node in hierarchy
» kittyhawk.cmcl.cs.cmu.edu maps to stores a list of names that
128.2.194.242 end with same suffix
root
z Multiple domain names maps to the same IP address: org • Suffix = path up tree
eecs mit edu and cs.mit.edu
» eecs.mit.edu cs mit edu both map to net edu com uk • E.g., given this tree, where
18.62.1.6 would following be stored:
gwu ucb cmu bu mit • Fred.com
z Single domain name maps to multiple IP addresses:
cs ece • Fred.edu
» aol.com and www.aol.com map to multiple IP
addrs. cmcl • Fred.cmu.edu
• Fred.cmcl.cs.cmu.edu
z Some valid domain names don’t map to any IP address:
• Fred.cs.mit.edu
» for example: cmcl.cs.cmu.edu

11 12

2
2/23/2008

DNS Design: Zone Definitions DNS Design: Cont.


• Zone = contiguous section z Zones are created by convincing owner node
of name space to create/delegate a subzone
root
• E.g., Complete tree, single » Records within zone stored multiple redundant
node or subtree name servers
org ca
net edu com uk • A zone has an associated » Primary/master name server updated manually
set of name servers » Secondary/redundant
S / servers updated by zone
transfer of name space
gwu ucb cmu bu mit • Must store list of names and
tree links – Zone transfer is a bulk transfer of the
cs ece Subtree “configuration” of a DNS server – uses
cmcl TCP to ensure reliability
Single node
z Example:
Complete » CS.CMU.EDU created by CMU.EDU administrators
Tree » Who creates CMU.EDU or .EDU?

13 14

DNS: Root Name Servers Servers/Resolvers


z Responsible for “root”
zone
z Each host has a resolver
z Approx. 13 root name
» Typically a library that applications can link to
servers worldwide
» Currently {a-m}.root-
» Local name servers hand-configured (e.g.
servers net
servers.net /etc/resolv.conf)
z Local name servers z Name servers
contact root servers » Either responsible for some zone or…
when they cannot
» Local servers
resolve a name
– Do lookup of distant host names for local hosts
» Configured with well-
known root servers – Typically answer queries about local zone
» Newer picture Æ
www.root-servers.org
15 16

Typical Resolution Typical Resolution

z Steps for resolving www.cmu.edu


» Application calls gethostbyname() (RESOLVER)
root & edu
» Resolver contacts local name server (S1)
www.cs.cmu.edu
DNS server
» S1 queries root server (S2) for (www.cmu.edu)
» S2 returns NS record for cmu.edu (S3)
ns1.cmu.edu » What about A record for S3?
Local DNS server
Client – This is what the additional information section is for
DNS server (PREFETCHING)
ns1.cs.cmu.edu
DNS » S1 queries S3 for www.cmu.edu
server » S3 returns A record for www.cmu.edu
z Can return multiple A records Æ what does
this mean?
17 Lecture 13: 10-10-2006 18 18

3
2/23/2008

Lookup Methods Workload and Caching


Recursive query:
z Server goes out and
root name server z Are all servers/names likely to be equally popular?
searches for more info 2 » Why might this be a problem?
(recursive) iterated query
» How can we solve this problem?
z Only returns final answer
or “not found” 3 z DNS responses are cached
4
Iterative q
query:
y » Quick response for repeated translations
z Server responds with as 7
much as it knows » Other queries may reuse some parts of lookup
(iterative) local name server intermediate name server – NS records for domains
dns.eurecom.fr dns.umass.edu
“I don’t know this name,
z
but ask this server” 5 6 authoritative name z DNS negative queries are cached
1 8
server » Don’t have to repeat past mistakes
dns.cs.umass.edu
Workload impact on » E.g. misspellings, search strings in resolv.conf
choice?
z Local server typically requesting host
z Cached data periodically times out
gaia.cs.umass.edu
does recursive surf.eurecom.fr » Lifetime (TTL) of data controlled by owner of data
z Root/distant server does
iterative 19 » TTL passed with every record 20

Typical Resolution Subsequent Lookup Example

root & edu root & edu


www.cs.cmu.edu
DNS server ftp.cs.cmu.edu
DNS server

ns1.cmu.edu cmu.edu
Local DNS server Local DNS server
Client Client
DNS server DNS server
ns1.cs.cmu.edu cs.cmu.edu
DNS DNS
server server

21 22

Reliability Reverse DNS


unnamed root

z DNS servers are replicated z Task


» Given IP address, find its name
» Name service available if ≥ one replica is up arpa edu
» Queries can be load balanced between replicas
z Method
» Maintain separate hierarchy
z UDP used for queries in addr
in-addr cmu based on IP names
» Need reliability Æ must implement this on top of » Write 128.2.194.242 as
UDP! 242.194.128.2.in-addr.arpa
128 cs – Why is the address reversed?
» Why not just use TCP?
z Managing
z Try alternate servers on timeout 2
» Authority manages IP addresses
» Exponential backoff when retrying same server cmcl
assigned to it
194
z Same identifier for all queries » E.g., CMU manages name space
128.2.in-addr.arpa
» Don’t care which server responds kittyhawk
242
23 128.2.194.242 24

4
2/23/2008

.arpa Name Server Hierarchy Prefetching

in-addr.arpa a.root-servers.net • • • m.root-servers.net


z Name servers can add additional data to
chia.arin.net response
128
(dill, henna, indigo, epazote, figwort, ginseng)
z Typically used for prefetching
cucumber.srv.cs.cmu.edu,
b d » CNAME/MX/NS typically
i ll point
i to another
h host
h name
2 t-ns1.net.cmu.edu
t-ns2.net.cmu.edu » Responses include address of host referred to in
“additional section”
mango.srv.cs.cmu.edu
194
(peach, banana, blueberry)

z At each level of hierarchy, have


kittyhawk
128.2.194.242 group of servers that are authorized
to handle that region of hierarchy
25 26

Mail Addresses Outline

z MX records point to mail exchanger for a


name
» E.g. mail.acm.org is MX for acm.org z DNS Design
z Addition of MX record type proved to be a
challenge
» How to get mail programs to lookup MX
record for mail delivery? z DNS Today
» Needed critical mass of such mailers

27 28

Root Zone gTLDs


z Unsponsored
» .com, .edu, .gov, .mil, .net, .org
z Generic Top Level Domains (gTLD) = .com, » .biz Æ businesses
.info Æ general info
.net, .org, etc… »
» .name Æ individuals
z Country Code Top Level Domain (ccTLD) = z Sponsored (controlled by a particular association)
.us,, .ca,, .fi,, .uk,, etc… » .aero Æ air-transport industry
» .cat Æ catalan related
z Root server ({a-m}.root-servers.net) also used » .coop Æ business cooperatives
to cover gTLD domains » .jobs Æ job announcements
» .museum Æ museums
» Load on root servers was growing quickly! » .pro Æ accountants, lawyers, and physicians
» Moving .com, .net, .org off root servers was clearly » .travel Æ travel industry
necessary to reduce load Æ done Aug 2000 z Starting up
» .mobi Æ mobile phone targeted domains
» .post Æ postal
» .tel Æ telephone related
z Proposed
» .asia, .cym, .geo, .kid, .mail, .sco, .web, .xxx
29 30

5
2/23/2008

New Registrars Measurements of DNS


z No centralized caching per site
z Network Solutions (NSI) used to handle all » Each machine runs own caching local server
registrations, root servers, etc… » Why is this a problem?
» How many hosts do we need to share cache? Æ recent
» Clearly not the democratic (Internet) way studies suggest 10-20 hosts
» Large number of registrars that can create new z “Hit rate
t ffor DNS = 80% Æ 1 - (#DNS/#connections)
(#DNS/# ti )
domains Æ However NSI still handles A root server
» Is this good or bad?
» Most Internet traffic was Web with HTTP 1.0
– What does a typical page look like? Æ average of 4-5 imbedded
objects Æ needs 4-5 transfers
– This alone accounts for 80% hit rate!
z Lower TTLs for A records does not affect
performance
z DNS performance really relies more on NS-record
Lecture 13: 10-10-2006 31 31 caching Lecture 13: 10-10-2006 32 32

Tracing Hierarchy (1) Tracing Hierarchy (2)


z Dig Program z 3 servers handle CMU names
» Allows querying of DNS system
» Use flags to find name server (NS) unix> dig +norecurse @e3.nstld.com NS kittyhawk.cmcl.cs.cmu.edu

» Disable recursion so that operates one step at a time ;; AUTHORITY SECTION:


unix> dig +norecurse @a.root-servers.net NS kittyhawk.cmcl.cs.cmu.edu cmu.edu. 172800 IN NS CUCUMBER.SRV.cs.cmu.edu.
cmu.edu. 172800 IN NS T-NS1.NET.cmu.edu.
;; AUTHORITY SECTION: cmu.edu. 172800 IN NS T-NS2.NET.cmu.edu.
edu. 172800 IN NS L3.NSTLD.COM.
edu. 172800 IN NS D3.NSTLD.COM.
edu. 172800 IN NS A3.NSTLD.COM.
edu. 172800 IN NS E3.NSTLD.COM.
edu. 172800 IN NS C3.NSTLD.COM.
edu. 172800 IN NS F3.NSTLD.COM.
edu. 172800 IN NS G3.NSTLD.COM.
edu. 172800 IN NS B3.NSTLD.COM.
edu. 172800 IN NS M3.NSTLD.COM.
» All .edu names handled by set of servers 33 34

Tracing Hierarchy (3 & 4) DNS (Summary)


z 4 servers handle CMU CS names z Motivations Æ large distributed database
unix> dig +norecurse @t-ns1.net.cmu.edu NS kittyhawk.cmcl.cs.cmu.edu
» Scalability
» Independent update
;; AUTHORITY SECTION: » Robustness
cs.cmu.edu. 86400 IN NS MANGO.SRV.cs.cmu.edu.
cs cmu edu
cs.cmu.edu. 86400 IN NS PEACH
PEACH.SRV.cs.cmu.edu.
SRV cs cmu edu z Hierarchical database structure
cs.cmu.edu. 86400 IN NS BANANA.SRV.cs.cmu.edu.
» Zones
cs.cmu.edu. 86400 IN NS BLUEBERRY.SRV.cs.cmu.edu.
» How is a lookup done
z Caching/prefetching and TTLs
z Quasar is master
unix>dig +norecurse NS for this zoneNS
@blueberry.srv.cs.cmu.edu
kittyhawk.cmcl.cs.cmu.edu
z Reverse name lookup
z What are the steps to creating your own
;; AUTHORITY SECTION:
domain?
cs.cmu.edu. 300 IN SOA QUASAR.FAC.cs.cmu.edu.

35 Lecture 13: 10-10-2006 36 36

You might also like