1 EE 122: Domain Name System Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,

Slides:



Advertisements
Similar presentations
Domain Name System (DNS) Name resolution for both small and large networks Host names IP Addresses Like a phone book, but stores more information Older.
Advertisements

DNS – Domain Name system Converting domain names to IP addresses since 1983.
CSCI-1680 DNS Based partly on lecture notes by Scott Shenker and John Jannotti Rodrigo Fonseca.
Domain Name System (or Service) (DNS) Computer Networks Computer Networks Term B10.
1 EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Domain Name System (or Service) (DNS) Computer Networks Computer Networks Spring 2012 Spring 2012.
EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
2: Application Layer1 FTP, SMTP and DNS. 2: Application Layer2 FTP: separate control, data connections r FTP client contacts FTP server at port 21, specifying.
1 Domain Name System (DNS) Reading: Section 9.1 COS 461: Computer Networks Spring 2006 (MW 1:30-2:50 in Friend 109) Jennifer Rexford Teaching Assistant:
EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
1 Domain Name System (DNS). 2 DNS: Domain Name System Internet hosts, routers: –IP address (32 bit) - used for addressing datagrams –“name”, e.g., gaia.cs.umass.edu.
EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
Application Layer session 1 TELE3118: Network Technologies Week 12: DNS Some slides have been taken from: r Computer Networking: A Top Down Approach.
1 Translating Addresses Reading: Section 4.1 and 9.1 COS 461: Computer Networks Spring 2007 (MW 1:30-2:50 in Friend 004) Jennifer Rexford Teaching Assistant:
1 Translating Addresses Reading: Section 4.1 and 9.1 COS 461: Computer Networks Spring 2008 (MW 1:30-2:50 in COS 105) Jennifer Rexford Teaching Assistants:
Naming Jennifer Rexford Advanced Computer Networks Tuesdays/Thursdays 1:30pm-2:50pm.
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks Domain.
Name Resolution and DNS. Domain names and IP addresses r People prefer to use easy-to-remember names instead of IP addresses r Domain names are alphanumeric.
Chapter 2 Application Layer
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
NET0183 Networks and Communications Lecture 25 DNS Domain Name System 8/25/20091 NET0183 Networks and Communications by Dr Andy Brooks.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Domain Name System Steve Ko Computer Sciences and Engineering University at Buffalo.
CS 4396 Computer Networks Lab
1 Domain Name System (DNS). 2 DNS: Domain Name System Internet hosts: – IP address (32 bit) - used for addressing datagrams – “name”, e.g.,
Domain Name System (DNS)
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 10 Omar Meqdadi Department of Computer Science and Software Engineering University.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
CS 471/571 Domain Name Server Slides from Kurose and Ross.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
DNS: Domain Name System
Review: –Which protocol is used to move messages around in the Internet? –Describe how a message is moved from the sender’s UA to the receiver’s.
1 DNS: Domain Name System People: many identifiers: m SSN, name, Passport # Internet hosts, routers: m IP address (32 bit) - used for addressing datagrams.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April A note on the use.
DNS: Domain Name System People: many identifiers: – SSN, name, Passport # Internet hosts, routers: – IP address (32 bit) - used for addressing datagrams.
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Naming and the DNS. Names and Addresses  Names are identifiers for objects/services (high level)  Addresses are locators for objects/services (low level)
Internet and Intranet Protocols and Applications Lecture 5 Application Protocols: DNS February 20, 2002 Joseph Conron Computer Science Department New York.
CPSC 441: DNS 1. DNS: Domain Name System Internet hosts: m IP address (32 bit) - used for addressing datagrams m “name”, e.g., - used by.
CS 3830 Day 10 Introduction 1-1. Announcements r Quiz #2 this Friday r Program 2 posted yesterday 2: Application Layer 2.
Discovery Jennifer Rexford COS 461: Computer Networks Lectures: MW 10-10:50am in Architecture N101
Lecture 5: Web Continued 2-1. Outline  Network basics:  HTTP protocols  Studies on HTTP performance from different views:  Browser types [NSDI 2014]
Lecture 7: Domain Name Service (DNS) Reading: Section 9.1 ? CMSC 23300/33300 Computer Networks
Spring 2015© CS 438 Staff1 DNS. Host Names vs. IP addresses Host names  Mnemonic name appreciated by humans  Variable length, full alphabet of characters.
1 EEC-484/584 Computer Networks Lecture 5 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer Networking book.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
1 Kyung Hee University Chapter 19 DNS (Domain Name System)
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
1. Internet hosts:  IP address (32 bit) - used for addressing datagrams  “name”, e.g., ww.yahoo.com - used by humans DNS: provides translation between.
Application Layer, 2.5 DNS 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
CSEN 404 Application Layer II Amr El Mougy Lamia Al Badrawy.
Spring 2006 CPE : Application Layer_DNS 1 Special Topics in Computer Engineering Application layer: Domain Name System Some of these Slides are.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
CSE 486/586 Distributed Systems Web Content Distribution---1 DNS & CDN
Introduction to Networks
Session 6 INST 346 Technologies, Infrastructure and Architecture
Chapter 9: Domain Name Servers
Domain Name System (DNS)
Cookies, Web Cache & DNS Dr. Adil Yousif.
Domain Name System (DNS)
EEC-484/584 Computer Networks
DNS: Domain Name System
Domain Name System (DNS)
FTP, SMTP and DNS 2: Application Layer.
Naming in Networking Jennifer Rexford COS 316 Guest Lecture.
Presentation transcript:

1 EE 122: Domain Name System Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson, Jennifer Rexford, and colleagues at UC Berkeley)

2 Goals of Today’s Lecture Concepts & principles underlying the Domain Name System (DNS) Indirection: names in place of addresses Hierarchy: in names, addresses, and servers Caching: of mappings from names to/from addresses Inner workings of DNS DNS resolvers and servers Iterative and recursive queries TTL-based caching Use of the dig utility Security analysis

3 Host Names vs. IP addresses Host names Mnemonic name appreciated by humans Variable length, full alphabet of characters Provide little (if any) information about location Examples: and bbc.co.uk IP addresses Numerical address appreciated by routers Fixed length, binary number Hierarchical, related to host location Examples: and

4 Separating Naming and Addressing Names are easier to remember vs Addresses can change underneath Move to E.g., renumbering when changing providers Name could map to multiple IP addresses to multiple (8) replicas of the Web site Enables Load-balancing Reducing latency by picking nearby servers Tailoring content based on requester’s location/identity Multiple names for the same address E.g., aliases like and cnn.com

5 Scalable (Name  Address) Mappings Originally: per-host file Flat namespace /etc/hosts (what is this on your computer today?) SRI (Menlo Park) kept master copy Downloaded regularly Single server doesn’t scale Traffic implosion (lookups & updates) Single point of failure Amazing politics Need a distributed, hierarchical collection of servers

6 Domain Name System (DNS) Properties of DNS Hierarchical name space divided into zones Zones distributed over collection of DNS servers Hierarchy of DNS servers Root (hardwired into other servers) Top-level domain (TLD) servers Authoritative DNS servers Performing the translations Local DNS servers Resolver software

7 Distributed Hierarchical Database comeduorgac uk zw arpa unnamed root bar westeast foomy ac cam usr in- addr generic domainscountry domains my.east.bar.edu usr.cam.ac.uk Top-Level Domains (TLDs)

8 DNS Root Located in Virginia, USA How do we make the root scale? Verisign, Dulles, VA

9 DNS Root Servers 13 root servers (see Labeled A through M Does this scale? B USC-ISI Marina del Rey, CA L ICANN Los Angeles, CA E NASA Mt View, CA F Internet Software Consortium Palo Alto, CA I Autonomica, Stockholm K RIPE London M WIDE Tokyo A Verisign, Dulles, VA C Cogent, Herndon, VA D U Maryland College Park, MD G US DoD Vienna, VA H ARL Aberdeen, MD J Verisign

10 DNS Root Servers 13 root servers (see Labeled A through M Replication via any-casting (localized routing for addresses) B USC-ISI Marina del Rey, CA L ICANN Los Angeles, CA E NASA Mt View, CA F Internet Software Consortium, Palo Alto, CA (and 37 other locations) I Autonomica, Stockholm (plus 29 other locations) K RIPE London (plus 16 other locations) M WIDE Tokyo plus Seoul, Paris, San Francisco A Verisign, Dulles, VA C Cogent, Herndon, VA (also Los Angeles, NY, Chicago) D U Maryland College Park, MD G US DoD Vienna, VA H ARL Aberdeen, MD J Verisign (21 locations)

11 TLD and Authoritative DNS Servers Top-level domain (TLD) servers Generic domains (e.g., com, org, edu) Country domains (e.g., uk, fr, cn, jp) Special domains (e.g., arpa) Typically managed professionally Network Solutions maintains servers for “com” Educause maintains servers for “edu” Authoritative DNS servers Provide public records for hosts at an organization Private records may differ, though not part of original design’s intent For the organization’s servers (e.g., Web and mail) Can be maintained locally or by a service provider

12 Using DNS Local DNS server (“default name server”) Usually near the endhosts that use it Local hosts configured with local server (e.g., /etc/resolv.conf ) or learn server via DHCP Client application Extract server name (e.g., from the URL) Do gethostbyname() to trigger resolver code Server application Extract client IP address from socket Optional gethostbyaddr() to translate into name

13 requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server Example Host at cis.poly.edu wants IP address for gaia.cs.umass.ed u

14 How did it know the root server IP? Hard-coded What if it changes?

15 Recursive vs. Iterative Queries Recursive query Ask server to get answer for you E.g., request 1 and response 8 Iterative query Ask server who to ask next E.g., all other request- response pairs requesting host cis.poly.edu root DNS server local DNS server dns.poly.edu authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server

16 Reverse Mapping (Address  Host) How do we go the other direction, from an IP address to the corresponding hostname? Addresses already have natural “quad” hierarchy: But: quad notation has most-sig. hierarchy element on left, while has it on the right Idea: reverse the quads = … … and look that up in the DNS Under what TLD? Convention: in-addr.arpa So lookup is for in-addr.arpa

17 Distributed Hierarchical Database comeduorgac uk zw arpa unnamed root bar westeast foomy ac cam usr in- addr generic domainscountry domains my.east.bar.edu usr.cam.ac.uk /24

18 DNS Caching Performing all these queries takes time And all this before actual communication takes place E.g., 1-second latency before starting Web download Caching can greatly reduce overhead The top-level servers very rarely change Popular sites (e.g., visited often Local DNS server often has the information cached How DNS caching works DNS servers cache responses to queries Responses include a “time to live” (TTL) field Server deletes cached entry after TTL expires

19 Negative Caching Remember things that don’t work Misspellings like and These can take a long time to fail the first time Good to remember that they don’t work … so the failure takes less time the next time around But: negative caching is optional And not widely implemented

20 DNS Resource Records DNS: distributed DB storing resource records (RR) Type=NS name is domain (e.g. foo.com) value is hostname of authoritative name server for this domain Type=PTR name is reversed IP quads E.g in-addr.arpa value is corresponding hostname RR format: (name, value, type, ttl) Type=A –name is hostname –value is IP address Type=CNAME –name is alias name for some “canonical” name E.g., is really eecsweb.mit.edu –value is canonical name Type=MX –value is name of mailserver associated with name –Also includes a weight/preference

21 DNS Protocol DNS protocol: query and reply messages, both with same message format Message header: Identification: 16 bit # for query, reply to query uses same # Flags: –Query or reply –Recursion desired –Recursion available –Reply is authoritative Plus fields indicating size (0 or more) of optional header elements Additional information (variable # of resource records) Questions (variable # of resource records) Answers (variable # of resource records) Authority (variable # of resource records) # Authority RRs# Additional RRs IdentificationFlags # Questions# Answer RRs 16 bits

22 Interactive DNS lookups using dig dig program on Unix Allows querying of DNS system Dumps each field in DNS responses By default, executes recursive queries Disable via +norecurse so that operates one step at a time

23 unix> dig ; > DiG > ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: ;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 14 ;; QUESTION SECTION: ; IN A ;; AUTHORITY SECTION: com IN NS A.GTLD-SERVERS.NET. com IN NS G.GTLD-SERVERS.NET. com IN NS H.GTLD-SERVERS.NET. com IN NS C.GTLD-SERVERS.NET. com IN NS I.GTLD-SERVERS.NET. com IN NS B.GTLD-SERVERS.NET. com IN NS D.GTLD-SERVERS.NET. com IN NS L.GTLD-SERVERS.NET. com IN NS F.GTLD-SERVERS.NET. com IN NS J.GTLD-SERVERS.NET. com IN NS K.GTLD-SERVERS.NET. com IN NS E.GTLD-SERVERS.NET. com IN NS M.GTLD-SERVERS.NET. Note, no “ ANSWER ” section

24 ;; ADDITIONAL SECTION: A.GTLD-SERVERS.NET IN AAAA 2001:503:a83e::2:30 A.GTLD-SERVERS.NET IN A G.GTLD-SERVERS.NET IN A H.GTLD-SERVERS.NET IN A C.GTLD-SERVERS.NET IN A I.GTLD-SERVERS.NET IN A B.GTLD-SERVERS.NET IN AAAA 2001:503:231d::2:30 B.GTLD-SERVERS.NET IN A D.GTLD-SERVERS.NET IN A L.GTLD-SERVERS.NET IN A F.GTLD-SERVERS.NET IN A J.GTLD-SERVERS.NET IN A K.GTLD-SERVERS.NET IN A E.GTLD-SERVERS.NET IN A ;; Query time: 117 msec ;; SERVER: #53(a.root-servers.net) ;; WHEN: Mon Sep 25 11:13: ;; MSG SIZE rcvd: 501

25 dig ; > DiG > ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 74 ;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 4, ADDITIONAL: 4 ;; QUESTION SECTION: ; IN A ;; AUTHORITY SECTION: cnn.com IN NS twdns-01.ns.aol.com. cnn.com IN NS twdns-02.ns.aol.com. cnn.com IN NS twdns-03.ns.aol.com. cnn.com IN NS twdns-04.ns.aol.com. ;; ADDITIONAL SECTION: twdns-01.ns.aol.com IN A twdns-02.ns.aol.com IN A twdns-03.ns.aol.com IN A twdns-04.ns.aol.com IN A

26 dig … ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: IN CNAME cnn.com. cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A cnn.com. 300 IN A ;; AUTHORITY SECTION: cnn.com. 600 IN NS twdns-02.ns.aol.com. cnn.com. 600 IN NS twdns-03.ns.aol.com. cnn.com. 600 IN NS twdns-04.ns.aol.com. cnn.com. 600 IN NS twdns-01.ns.aol.com.

27 Reliability DNS servers are replicated Name service available if at least one replica is up Queries can be load-balanced between replicas Usually, UDP used for queries Need reliability: must implement this on top of UDP Spec supports TCP too, but not always implemented Try alternate servers on timeout Exponential backoff when retrying same server Same identifier for all queries Don’t care which server responds

28 Inserting Resource Records into DNS Example: just created startup “FooBar” Get a block of address space from ISP Say /25 Register foobar.com at Network Solutions (say) Provide registrar with names and IP addresses of your authoritative name server (primary and secondary) Registrar inserts RR pairs into the com TLD server: ( foobar.com, dns1.foobar.com, NS ) ( dns1.foobar.com, , A ) Put in your (authoritative) server dns1.foobar.com: Type A record for Type MX record for foobar.com

29 Setting up foobar.com, con’t In addition, need to provide reverse PTR bindings E.g.,  dns1.foobar.com Normally, these would go in in-addr.arpa Problem: you can’t run the name server for that domain. Why not? Because your block is /25, not /24 And whoever has /25 won’t be happy with you owning their PTR records Solution: ISP runs it for you Now it’s more of a headache to keep it up-to-date :-(

30 Security Analysis of DNS What security issues does the design & operation of the Domain Name System raise? Degrees of freedom: Additional information (variable # of resource records) Questions (variable # of resource records) Answers (variable # of resource records) Authority (variable # of resource records) # Authority RRs# Additional RRsIdentificationFlags# Questions# Answer RRs 16 bits

31 Security Problem #1: Starbucks As you sip your latte and surf the Web, how does your laptop find google.com? Answer: it asks the local name server per Dynamic Host Configuration Protocol (DHCP) … … which is run by Starbucks or their contractor … and can return to you any answer they please … including a “man in the middle” site that forwards your query to Google, gets the reply to forward back to you, yet can change anything they wish in either direction How can you know you’re getting correct data? Today, you can’t. (Though if site is HTTPS, that helps) One day, hopefully: DNSSEC extensions to DNS

32 Security Problem #2: Cache Poisoning Suppose you are a Bad Guy and you control the name server for foobar.com. You receive a request to resolve and reply: ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: IN A ;; AUTHORITY SECTION: foobar.com. 600 IN NS dns1.foobar.com. foobar.com. 600 IN NS google.com. ;; ADDITIONAL SECTION: google.com. 5 IN A A foobar.com machine, not google.com Evidence of the attack disappears 5 seconds later!

33 Cache Poisoning, con’t Okay, but how do you get the victim to look up in the first place? Perhaps you connect to their mail server and send HELO Which their mail server then looks up to see if it corresponds to your source address (anti-spam measure) Note, with compromised name server we can also lie about PTR records (address  name mapping) E.g., for = in-addr.arpa return google.com (or whitehouse.gov, or whatever) If our ISP lets us manage those records as we see fit, or we happen to directly manage them

34 Cache Poisoning, con’t Suppose Bad Guy is at Starbucks and they can sniff (or even guess) the identification field the local server will use in its next request: They: Ask local server for a (recursive) lookup of google.com Locally spoof subsequent reply from correct name server using the identification field Bogus reply arrives sooner than legit one Local server duly caches the bogus reply! Now: every future Starbuck customer is served the bogus answer out of the local server’s cache In this case, the reply uses a large TTL IdentificationFlags 16 bits

35 Summary Domain Name System (DNS) Distributed, hierarchical database Indirection gets us human-readable names, ability to change address, etc. Caching to improve performance Examine using dig utility DNS lacks authentication Can’t tell if reply comes from the correct source Can’t tell if correct source tells the truth Malicious source can insert extra (mis)information Malicious bystander can spoof (mis)information Playing with caching lifetimes adds extra power to attacks

36 Next Lecture An application protocol: The Web Reading: K&R 2.2 Homework 2 due 3:59 pm (this Wed) Project 1 checkpoint due Oct 11:59:59 pm