DNS: Domain Name System



Similar documents
DNS: Domain Name System

Domain Name System (or Service) (DNS) Computer Networks Term B10

Domain Name System Richard T. B. Ma

CMPE 80N: Introduction to Networking and the Internet

How To Map Between Ip Address And Name On A Domain Name System (Dns)

Chapter 2 Application Layer

DNS and P2P File Sharing

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

Domain Name System (DNS)

The Application Layer: DNS

internet technologies and standards

CS 43: Computer Networks Naming and DNS. Kevin Webb Swarthmore College September 17, 2015

DATA COMMUNICATOIN NETWORKING

DNS: Domain Name System

FTP: the file transfer protocol

Domain Name System (DNS) RFC 1034 RFC

Domain Name System DNS

Names vs. Addresses. Flat vs. Hierarchical Space. Domain Name System (DNS) Computer Networks. Lecture 5: Domain Name System

Naming and the DNS. Focus. How do we name hosts etc.? Application Presentation Topics. Session Domain Name System (DNS) /URLs

DNS. Spring 2016 CS 438 Staff 1

Domain Name System (DNS) Reading: Section in Chapter 9

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting, NTP

Domain Name System (DNS)

Application Layer. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross

DNS and electronic mail. DNS purposes

NET0183 Networks and Communications

CS 348: Computer Networks. - DNS; 22 nd Oct Instructor: Sridhar Iyer IIT Bombay

2.5 DNS The Internet s Directory Service

DNS: Domain Names. DNS: Domain Name System. DNS: Root name servers. DNS name servers

Computer Networks & Security 2014/2015

Network programming, DNS, and NAT. Copyright University of Illinois CS 241 Staff 1

C 1. Last Time. CSE 486/586 Distributed Systems Domain Name System. Review: Causal Ordering. Review: Causally Ordered Multicast.

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Application-layer protocols

FTP: the file transfer protocol

Lecture 2 CS An example of a middleware service: DNS Domain Name System

Internet-Praktikum I Lab 3: DNS

CSE/ISE 311: Systems Administra5on Networking 2

Resilient Networking. Overview of DNS Known attacks on DNS Denial-of-Service Cache Poisoning. Securing DNS Split-Split-DNS DNSSEC.

DNS records. RR format: (name, value, type, TTL) Type=NS

HW2 Grade. CS585: Applications. Traditional Applications SMTP SMTP HTTP 11/10/2009

The Domain Name System

Domain Name System (DNS) Omer F. Rana. Networks and Data Communications 1

3. The Domain Name Service

Applications & Application-Layer Protocols: The Domain Name System and Peerto-Peer

Communicating Applications

Chapter 23 The Domain Name System (DNS)

DNS Domain Name System

INTERNET DOMAIN NAME SYSTEM

Lecture 5: Network Attacks I. Course Admin

CS640: Computer Networks. Naming /ETC/HOSTS

Network(Security(Protocols(

1 Introduction: Network Applications

The Domain Name System

Distributed Systems. 09. Naming. Paul Krzyzanowski. Rutgers University. Fall 2015

Names & Addresses. Names & Addresses. Names vs. Addresses. Identity. Names vs. Addresses. CS 194: Distributed Systems: Naming

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP

Types of hypertext. Hypertext documents can either be 1.Static 2.Dynamic

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Motivation. Domain Name System (DNS) Flat Namespace. Hierarchical Namespace

CS244A Review Session Routing and DNS

The Domain Name System

Chapter 9: Name Services. 9.1 Introduction 9.2 Name services and the DNS 9.3 Directory services 9.6 Summary

Tanenbaum, Computer Networks (extraits) Adaptation par J.Bétréma. DNS The Domain Name System

Computer Networks Prof. S. Ghosh Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 34 DNS & Directory

Introduction to Network Operating Systems

The Domain Name System (DNS)

CS3600 SYSTEMS AND NETWORKS

Brazil + JDBC Juin 2001, douin@cnam.fr

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Understanding DNS (the Domain Name System)

416 Distributed Systems. Feb 24, 2016 DNS and CDNs

Domain Name Servers. Domain Types WWW host names. Internet Names. COMP476 Networked Computer Systems. Domain Name Servers

Resilient Networking. Thorsten Strufe. Module 5: Name Resolution / DNS

Part 5 DNS Security. SAST01 An Introduction to Information Security Martin Hell Department of Electrical and Information Technology

Computer Networks: Domain Name System

The Domain Name System (DNS)

ECE 4321 Computer Networks. Network Programming

CS3250 Distributed Systems

- Domain Name System -

Langages Orientés Objet Java

Transcription:

DNS: Domain Name System People: many identifiers: SSN, name, passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams name, e.g., ww.yahoo.com - used by humans Q: map between IP addresses and name? Domain Name System: distributed database implemented in hierarchy of many name servers application-layer protocol host, routers, name servers to communicate to resolve names (address/name translation) note: core Internet function, implemented as application-layer protocol complexity at network s edge H. Fauconnier M2-Internet 1

DNS DNS services hostname to IP address translation host aliasing Canonical, alias names mail server aliasing load distribution replicated Web servers: set of IP addresses for one canonical name Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesn t scale! H. Fauconnier M2-Internet 2

Distributed, Hierarchical Database Root DNS Servers com DNS servers org DNS servers edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers poly.edu umass.edu DNS servers DNS servers Client wants IP for www.amazon.com; 1 st 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 H. Fauconnier M2-Internet 3

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 e NASA Mt View, CA f Internet Software C. Palo Alto, CA (and 36 other locations) a Verisign, Dulles, VA c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Verisign, ( 21 locations) k RIPE London (also 16 other locations) i Autonomica, Stockholm (plus 28 other locations) m WIDE Tokyo (also Seoul, Paris, SF) b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA 13 root name servers worldwide H. Fauconnier M2-Internet 4

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, providing authoritative hostname to IP mappings for organization s servers (e.g., Web, mail). can be maintained by organization or service provider H. Fauconnier M2-Internet 5

Local Name Server does not strictly belong to hierarchy each ISP (residential ISP, company, university) has one. 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 H. Fauconnier M2-Internet 6

DNS name resolution example root DNS server Host at cis.poly.edu wants IP address for gaia.cs.umass.edu 2 3 4 5 TLD DNS server iterated query: contacted server replies with name of server to contact I don t know this name, but ask this server local DNS server dns.poly.edu 1 8 requesting host cis.poly.edu 7 6 authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu H. Fauconnier M2-Internet 7

DNS name resolution example root DNS server recursive query: puts burden of name resolution on contacted name server heavy load? 2 local DNS server dns.poly.edu 7 6 5 3 4 TLD DNS server 1 8 requesting host cis.poly.edu authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu H. Fauconnier M2-Internet 8

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 H. Fauconnier M2-Internet 9

DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type, ttl) Type=A name is hostname value is IP address Type=NS name is domain (e.g. foo.com) value is hostname of authoritative name server for this domain Type=CNAME name is alias name for some canonical (the real) name www.ibm.com is really servereast.backup2.ibm.com value is canonical name Type=MX value is name of mailserver associated with name H. Fauconnier M2-Internet 10

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 H. Fauconnier M2-Internet 11

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 H. Fauconnier M2-Internet 12

Inserting records into DNS example: new startup Network Utopia register name networkuptopia.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 authoritative server Type A record for www.networkuptopia.com; Type MX record for networkutopia.com How do people get IP address of your Web site? H. Fauconnier M2-Internet 13

Quelques compléments Java réseaux 14

Sommaire URL et URI html et swing URLconnections URLStreamHandler URLStreamHandlerFactory ContentHandler ContentHandlerFactory 15

URL la classe URL permet d'utiliser les URL les classes URLDecoder et URLEncoder permettent de traiter les formulaires HTML Une URI (Uniform ressource Identifier), est une sorte de généralisation des URL qui inclut de Uniform Resource Location (URL) mais aussi de Uniform Ressource Names (URN) exemples tel:1-800-9988-9938 http://www.xml.comp/pub/stax.html#id =_hdbc (la classe URLConnection sera décrite plus loin) 16

URI URI: URL (location) http://java.sun.com/j2se/1.3/docs/guide/collections/ designfaq.html#28 ou URN (name): mailto:java-net@java.sun.com Syntaxe: Général: [scheme:]scheme-specific-part[#fragment] Hiérarchique: [scheme:][//authority][path][?query][#fragment] Authorité: [user-info@]host[:port] 1-17

URL http://www.bib.org:80/javafaq/book/index.html? isbn=56888#toc ftp://anonymous:anonymous@ftp.bib.org/c%3a/ stuff protocol port authority chemin référence requête user 18

Construire une URL public URL(String url) throws MalformedURLException public URL(String protocol, String hostname, String file) throws MalformedURLException public URL(String protocol, String host, int port, String file) throws MalformedURLException public URL(URL base, String relative) throws MalformedURLException 19

Remarques tous les protocoles ne sont pas compris par la machine virtuelle exception MalFormedURLException 20

Exemple: Quels protocoles? import java.net.*; public class ProtocolTester { public static void main(string[] args) { testprotocol("http://www.adc.org"); testprotocol("https://www.amazon.com/exec/obidos/order2/"); testprotocol("ftp://metalab.unc.edu/pub/languages/java/javafaq/"); testprotocol("mailto:elharo@metalab.unc.edu"); testprotocol("telnet://dibner.poly.edu/"); testprotocol("file:///etc/passwd"); testprotocol("gopher://gopher.anc.org.za/"); testprotocol( "ldap://ldap.itd.umich.edu/o=university%20of%20michigan,c=us? postaladdress"); testprotocol( "jar:http://cafeaulait.org/books/javaio/ioexamples/javaio.jar!" +"/com/macfaq/io/streamcopier.class"); testprotocol("nfs://utopia.poly.edu/usr/tmp/"); testprotocol("jdbc:mysql://luna.metalab.unc.edu:3306/news"); testprotocol("rmi://metalab.unc.edu/renderengine"); testprotocol("doc:/usersguide/release.html"); testprotocol("netdoc:/usersguide/release.html"); testprotocol("systemresource://www.adc.org/+/index.html"); testprotocol("verbatim:http://www.adc.org/"); 21

Quels protocoles (suite) private static void testprotocol(string url) { try { URL u = new URL(url); System.out.println(u.getProtocol() + " is supported"); catch (MalformedURLException ex) { String protocol = url.substring(0,url.indexof(':')); System.out.println(protocol + " is not supported"); http is supported https is supported ftp is supported mailto is supported telnet is not supported file is supported gopher is supported ldap is not supported jar is supported nfs is not supported jdbc is not supported rmi is not supported doc is supported netdoc is supported systemresource is supported verbatim is supported 22

Décomposer l'url public static void decomposeurl(string st) { try{ URL u = new URL(st); System.out.println("URL :" + u); System.out.println("Protocole : " + u.getprotocol( )); System.out.println("UserInfo :" + u.getuserinfo( )); String host = u.gethost( ); if (host!= null) { int atsign = host.indexof('@'); if (atsign!= -1) host = host.substring(atsign+1); System.out.println("hôte " + host); else { System.out.println("hôte null."); 23

suite System.out.println("Port :" + u.getport( )); System.out.println("Path : " + u.getpath( )); System.out.println("Ref : " + u.getref( )); System.out.println("Query: " + u.getquery( )); catch (MalformedURLException ex) {System.err.println(st + " URL malformée"); 24

Résultat http://www.bib.org:80/javafaq/book/index.html? isbn=56888#toc URL :http://www.bib.org:80/javafaq/book/ index.html?isbn=56888#toc Protocole : http UserInfo :null hôte www.bib.org Port :80 Path : /javafaq/book/index.html Ref : toc Query: isbn=56888 25

Obtenir des données public InputStream openstream( ) throws IOException public URLConnection openconnection( ) throws IOException public URLConnection openconnection(proxy proxy) throws IOException public Object getcontent( ) throws IOException public Object getcontent(class[] classes) throws IOException 26

Charger le contenu d'une URL public static void chargerfichier(string url) { try { URL u = new URL(url); InputStream in = u.openstream(); in = new BufferedInputStream(in); Reader r = new InputStreamReader(in); int c; while ((c = r.read())!= -1) { System.out.print((char) c); catch (MalformedURLException ex) { System.err.println(url + " mauvaise URL"); catch (IOException e) { System.err.println(e + " problème de lecture url " + url); 27

Type du contenu public static void typeobjeturl(string st) { try { URL u = new URL(st); try { Object o = u.getcontent(); System.out.println("L'objet est un " + o.getclass().getname()); catch (IOException ex) {System.err.println(ex); catch (MalformedURLException ex) { System.err.println(st + " URL malformée"); http://www.liafa.jussieu.fr L'objet est un sun.net.www.protocol.http.httpurlconnection $HttpInputStream 28

Et encore URLEncoder URLDecoder 29

URLEncode: Exemple public class QueryString { private StringBuffer query = new StringBuffer(); public QueryString(String name, String value) { encode(name, value); public synchronized void add(string name, String value) { query.append('&'); encode(name, value); private synchronized void encode(string name, String value){ try { query.append(urlencoder.encode(name, "UTF-8")); query.append('='); query.append(urlencoder.encode(value, "UTF-8")); catch (UnsupportedEncodingException ex) { throw new RuntimeException("??"); //... 30

Exemple (suite) / public String getquery() { return query.tostring(); public String tostring() { return getquery(); 31

Authentication Classe (abstraite) Authenticator PasswordAuthentication représente un couple password + user Méthode getpasswordauthentication() à redéfinir pour obtenir un PasswordAuthenitcation Méthode setdefault(authenticator) définit l'authenticator pour le système C'est à lui que s'adressera le système à chaque fois que nécessaire 32

Pour apache: Fichier.htaccess: (il faut aussi un AllowOverride AuthConfig dans httpd.conf) AuthType Basic AuthName "restreint" AuthUserFile /Users/hf/Sites/.psswd Require user hf.psswd est le fichier des mots de passe htpasswd c /Users/hf/Sites/.passwd hf 33

Exemple 34