Spring 2015© CS 438 Staff1 DNS. Host Names vs. IP addresses Host names  Mnemonic name appreciated by humans  Variable length, full alphabet of characters.

Slides:



Advertisements
Similar presentations
DNS – Domain Name system Converting domain names to IP addresses since 1983.
Advertisements

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.
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.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
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.
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.,
DNS & P2P A PPLICATIONS د. عـــادل يوسف أبو القاسم.
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,
1 EE 122: Domain Name System Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson,
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
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.
2: Application Layer1 DNS: Domain Name System People have many identifiers: SSN, name, passport number Internet hosts, routers have identifiers, too: IP.
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.
EE 122: Lecture 20 (Domain Name Server - DNS) Ion Stoica Nov 15, 2001 (* based on the some on-line slides of J. Kurose & K. Rose and of Raj Jain)
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
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.
COMP 431 Internet Services & Protocols
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.
Chapter 17 DNS (Domain Name System)
Introduction to Networks
Chapter 19 DNS (Domain Name System)
Session 6 INST 346 Technologies, Infrastructure and Architecture
Chapter 9: Domain Name Servers
Introduction to Communication Networks
Domain Name System (DNS)
Chapter 7: Application layer
Cookies, Web Cache & DNS Dr. Adil Yousif.
Domain Name System (DNS)
Chapter 19 DNS (Domain Name System)
EEC-484/584 Computer Networks
DNS: Domain Name System
Domain Name System (DNS)
FTP, SMTP and DNS 2: Application Layer.
Presentation transcript:

Spring 2015© CS 438 Staff1 DNS

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

Separating Naming and Addressing Names are easier to remember  cnn.com vs (but not shortened urls) Addresses can change underneath  Move to  e.g., renumbering when changing providers Spring 2015© CS 438 Staff3

Separating Naming and Addressing Name could map to multiple IP addresses  may refer 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 Spring 2015© CS 438 Staff4

Scalable (Name  Address) Mappings Originally: per-host file  Flat namespace  /etc/hosts  SRI (Menlo Park) kept master copy  Downloaded regularly Spring 2015© CS 438 Staff5

Scalable (Name  Address) Mappings Why not centralize DNS?  Single point of failure  Traffic volume  Distant centralized database  Maintenance Doesn’t scale! Root name server  Contacted by local name server that can not resolve name  Contacts authoritative name server if mapping not known  Gets mapping and returns it to local name server Spring 2015© CS 438 Staff6

Domain Name Service (DNS) Large scale dynamic, distributed application  Replaced Network Information Center (NIC) RFC 1034 and 1035 Name space  Set of possible names Bindings  Maps internet domain names into IP addresses Name server  Resolution mechanism Spring 2015© CS 438 Staff7

Applications’ use of 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 getaddrinfo() to trigger resolver code, sending message to server Server application  Extract client IP address from socket  Optional getnameinfo() to translate into name Spring 2015© CS 438 Staff8

DNS Root Located in Virginia, USA How do we make the root scale? Spring 2015© CS 438 Staff9 Verisign, Dulles, VA

DNS Root Servers 13 root servers (see )  Labeled A through M Does this scale? Spring 2015© CS 438 Staff10 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

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  Organization’s DNS servers  Provide authoritative hostname to IP mappings for organization’s servers (e.g., Web, mail).  Can be maintained by organization or service provider Spring 2015© CS 438 Staff11

Local Name Server One per ISP (residential ISP, company, university)  Also called “default name server” When host makes DNS query, query is sent to its local DNS server  Acts as proxy, forwards query into hierarchy  Reduces lookup latency for commonly searched hostnames Spring 2015© CS 438 Staff12

Spring 2015© CS 438 Staff13 Distributed, Hierarchical Database Client wants IP for  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 Root DNS Servers com DNS servers org DNS servers edu DNS servers uiuc.edu DNS servers umass.edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers

DNS – Name Server Host at cs.uiuc.edu  Wants IP address for gaia.cs.umass.edu Recursive query  Ask server to get answer for you  e.g., request 1 and response 8 Iterated query  Contacted server replies with name of server to contact  “I don’t know this name, but ask this server” Spring 2015© CS 438 Staff14 requesting host cs.uiuc.edu gaia.cs.umass.edu root DNS server local DNS server dns.uiuc.edu authoritative DNS server 7 8 TLD DNS server dns.cs.umass.edu

But how did it know the root server IP? Hard-coded What if it changes? Spring 2015© CS 438 Staff15

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 Spring 2015© CS 438 Staff16

DNS: Caching How DNS caching works  DNS servers cache responses to queries  Responses include a “time to live” (TTL) field 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 Spring 2015© CS 438 Staff17

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 Spring © CS 438 Staff

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 RRsIdentificationFlags# Questions# Answer RRs 16 bits Spring © CS 438 Staff

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 20Spring 2015© CS 438 Staff

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 21Spring 2015© CS 438 Staff

Setting up foobar.com In addition, need to provide reverse PTR bindings  e.g.,  dns1.foobar.com Normally, these 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  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 :-( 22Spring 2015© CS 438 Staff

DNS Measurements (MIT data from 2000) What is being looked up?  ~60% requests for A records  ~25% for PTR records  ~5% for MX records  ~6% for ANY records How long does it take?  Median ~100msec (but 90th percentile ~500msec)  80% have no referrals; 99.9% have fewer than four Query packets per lookup: ~2.4 23Spring 2015© CS 438 Staff

DNS Measurements (MIT data from 2000) Top 10% of names accounted for ~70% of lookups  Caching should really help! 9% of lookups are unique  Cache hit rate can never exceed 91% Cache hit rates ~ 75%  But caching for more than 10 hosts doesn’t add much 24Spring 2015© CS 438 Staff

DNS Measurements (MIT data from 2000) Does DNS give answers?  ~23% of lookups fail to elicit an answer!  ~13% of lookups result in NXDOMAIN (or similar) Mostly reverse lookups  Only ~64% of queries are successful! How come the web seems to work so well? ~ 63% of DNS packets in unanswered queries!  Failing queries are frequently retransmitted  99.9% successful queries have ≤2 retransmissions 25Spring 2015© CS 438 Staff

Moral of the Story If you design a highly resilient system, many things can be going wrong without you noticing it! 26Spring 2015© CS 438 Staff

Security Analysis of DNS What security issues does the design & operation of the Domain Name System raise? 27 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 Spring 2015© CS 438 Staff

Security Problem #1: Starbucks (and China…) 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 soon: DNSSEC extensions to DNS 28Spring 2015© CS 438 Staff

;; 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 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: 29 A foobar.com machine, not google.com Evidence of the attack disappears 5 seconds later! Spring 2015© CS 438 Staff

Cache Poisoning 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 30Spring 2015© CS 438 Staff

Cache Poisoning 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 Starbucks customer is served the bogus answer out of the local server’s cache In this case, the reply uses a large TTL 31Spring 2015© CS 438 Staff

Summary Domain Name System (DNS)  Distributed, hierarchical database  Distributed collection of servers  Caching to improve performance DNS currently 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 32Spring 2015© CS 438 Staff