Application Layer: DNS
A note on the use of these ppt slides:
Were making these slides freely available to all (faculty, students, readers).
Theyre in PowerPoint form so you can add, modify, and delete slides
(including this one) and slide content to suit your needs. They obviously
                                                                                  Computer Networking:
represent a lot of work on our part. In return for use, we only ask the           A Top Down Approach
following:
 If you use these slides (e.g., in a class) in substantially unaltered form,     Featuring the Internet.
that you mention their source (after all, wed like people to use our book!)
                                                                                  Jim Kurose, Keith Ross
 If you post any slides in substantially unaltered form on a www site, that
you note that they are adapted from (or perhaps identical to) our slides, and
note our copyright of this material.                                              Addison-Wesley.
Thanks and enjoy! JFK/KWR
All material copyright
J.F Kurose and K.W. Ross, All Rights Reserved
                                                                                      Transport Layer   3-1
DNS: Domain Name System
People: many identifiers:       Domain Name System:
      SSN, name, passport #     distributed database
Internet hosts, routers:          implemented in hierarchy of
                                  many name servers
      IP address (32 bit) -
                                 application-layer protocol
       used for addressing
                                  host, routers, name servers to
       datagrams
                                  communicate to resolve names
      name, e.g.,              (address/name translation)
       ww.yahoo.com - used by
                                    note: core Internet
       humans
                                     function, implemented as
Q: map between IP                    application-layer protocol
  addresses and name ?              complexity at networks
                                     edge
                                               2: Application Layer   2
 DNS
DNS services                 Why not centralize DNS?
 Hostname to IP              single point of failure
  address translation         traffic volume
 Host aliasing               distant centralized
      Canonical and alias     database
       names                  maintenance
 Mail server aliasing
 Load distribution
                             doesnt scale!
    Replicated Web
     servers: set of IP
     addresses for one
     canonical name
                                              2: Application Layer   3
Distributed, Hierarchical Database
                          Root DNS Servers
   com DNS servers        org DNS servers     edu DNS servers
                               pbs.org        poly.edu umass.edu
 yahoo.com amazon.com
                             DNS servers     DNS serversDNS servers
DNS servers DNS servers
Client wants IP for www.amazon.com; 1st approx:
 Client queries a root server to find com DNS
   server
 Client queries com DNS server to get amazon.com
   DNS server
 Client queries amazon.com DNS server to get IP
   address for www.amazon.com
                                                  2: Application Layer   4
DNS: Root name servers
 contacted by local name server that can not resolve name
 root name server:
      contacts authoritative name server if name mapping not known
      gets mapping
      returns mapping to local name server
                                                 2: Application Layer   5
TLD and Authoritative Servers
 Top-level domain (TLD) servers: responsible
  for com, org, net, edu, etc, and all top-level
  country domains uk, fr, ca, jp.
   Network solutions maintains servers for com TLD
   Educause for edu TLD
 Authoritative DNS servers: organizations
  DNS servers, providing authoritative
  hostname to IP mappings for organizations
  servers (e.g., Web and mail).
     Can be maintained by organization or service
      provider
                                          2: Application Layer   6
Local Name Server
 Does not strictly belong to hierarchy
 Each ISP (residential ISP, company,
  university) has one.
     Also called default name server
 When a host makes a DNS query, query is
  sent to its local DNS server
     Acts as a proxy, forwards query into hierarchy.
                                          2: Application Layer   7
                                         root DNS server
Example
                                     2
 Host at cis.poly.edu                      3
                                                     TLD DNS server
  wants IP address for                          4
  gaia.cs.umass.edu
                                                5
                         local DNS server
                          dns.poly.edu
                                                7        6
                                1    8
                                                authoritative DNS server
                                                  dns.cs.umass.edu
                         requesting host
                          cis.poly.edu
                                                    gaia.cs.umass.edu
                                                    2: Application Layer   8
Recursive queries                      root DNS server
    recursive query:
 puts burden of name              2                    3
      resolution on
     contacted name                     7       6
         server                                                 TLD DNS server
     heavy load?
     iterated query:   local DNS server
  contacted server     dns.poly.edu                5       4
  replies with name of
                             1     8
   server to contact
  I dont know this
                                            authoritative DNS server
   name, but ask this                         dns.cs.umass.edu
         server      requesting host
                        cis.poly.edu
                                              gaia.cs.umass.edu
                                                        2: Application Layer   9
DNS: caching and updating records
 once (any) name server learns mapping, it              caches
  mapping
   cache entries timeout (disappear) after some
    time
   TLD servers typically cached in local name
    servers
         Thus root name servers not often visited
 update/notify mechanisms under design by IETF
    RFC 2136
      http://www.ietf.org/html.charters/dnsind-charter.html
                                                    2: Application Layer   10
DNS records
DNS: distributed db storing resource records (RR)
                RR format: (name, value, type, ttl)
               Type=A                               Type=CNAME
          name is hostname              name is alias name for some
         value is IP address             canonical (the real) name
                                            www.ibm.com is really
 Type=NS                                servereast.backup2.ibm.com
    name is domain (e.g. foo.com)
                                            value is canonical name
    value is hostname of
     authoritative name server                        Type=MX
     for this domain                    value is name of mailserver
                                            associated with name
                                                          2: Application Layer   11
DNS protocol, messages
DNS protocol : query and reply messages, both with same message format
          msg header
  identification: 16 bit #
   for query, reply to query
         uses same #
           flags:
         query or reply
      recursion desired
      recursion available
     reply is authoritative
                                                       2: Application Layer   12
DNS protocol, messages
    Name, type fields
         for a query
      RRs in response
             to query
         records for
authoritative servers
   additional helpful
info that may be used
                          2: Application Layer   13
Inserting records into DNS
 Example: just created startup Network Utopia
 Register name networkuptopia.com at a registrar
  (e.g., Network Solutions)
      Need to provide registrar with names and IP addresses of
       your authoritative name server (primary and secondary)
      Registrar inserts two RRs into the com TLD server:
   (networkutopia.com, dns1.networkutopia.com, NS)
   (dns1.networkutopia.com, 212.212.212.1, A)
 Put in authoritative server Type A record for
  www.networkuptopia.com and Type MX record for
  networkutopia.com
 How do people get the IP address of your Web site?
                                                 2: Application Layer   14
DNS attacks: Cache poisoning
                               Transport Layer   3-15
DNS attacks: ID spoofing
                        DNS server also
                         replies though
                        Do ARP poisoning!
                        Or simultaneously
                         bring down the DNS
                         server through a
                         DoS attack!
                                Transport Layer   3-16