CS 355 Computer Networking Wei Lu, Ph.D., P.Eng.
Chapter 2: Application Layer Overview: Principles of network applications? Introduction to Wireshark Web and HTTP FTP Electronic Mail: SMTP, POP3, IMAP DNS: Domain Name System (or Service) P2P applications Socket programming with TCP and UDP
DNS: Introduction to DNS DNS naming structure DNS components: some concepts How DNS works: a rough idea Register a DNS for your own website?
An Introduction to DNS: Why DNS? What is DNS? What is DNS services? What is domain names and sub-domain names
Why DNS: naming issues on the Internet An address is how you get to an endpoint Typically, hierarchical (for scaling): e.g. 950 Charter Street, Redwood City CA, 94063 A name is how an endpoint is referenced Typically, no structurally significant hierarchy David, Tokyo, itu.int Computers work with numbers; Humans work with names ==> IP addresses are NUMBERS? Q: map between IP addresses and name? 1011011011101110110110
What is DNS Domain Name System: distributed database implemented in hierarchy of many name servers application-layer protocol in 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 Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesn t scale!
What is DNS service 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
What is domain (sub-domain) name? A domain name is the sequence of labels from a node to the root, separated by dots (. s), read left to right For example domain names: cs.keene.edu yahoo.com one domain is a sub-domain of another if its domain name ends in the other s domain name So cs.keene.edu is a subdomain of keene.edu edu google.com is a subdomain of com.
Naming Structure of DNS Top-level domain Second-level domain Distributed, hierarchical naming structure
DNS Naming Structure Top Level Domains (TLDs) defined by global authority com, org, edu cctld: country code TLDs. ca 2nd Level Domains. google.ca microsoft.com
Top-level Domains: an example
Country code domains: an example Top level domains are US-centric Geographic TLDs used for organizations in other countries: TLD.uk.ru.cn Country United Kingdom Russia China Countries define their own internal hierarchy: gov.cn, org.cn,net.cn, edu.cn and com.cn are used for organizations in China
Second/Third-level domains Within every top-level domain there is a huge list of 2 nd /3 rd level domains For example, in the COM second-level domain, we have: yahoo msn microsoft plus millions of others...
DNS naming structure: an example Examples: 2 nd LD TLD Google.com cctld hust.edu.cn 3 rd LD 2 nd LD
Distributed, hierarchical naming structure Root DNS Servers com DNS servers org DNS servers edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers keene.edu unh.edu DNS serversdns servers Client wants IP for www.amazon.com: 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
DNS naming structure: an analogy Naming a Domain Naming a Directory Start Here Start Here yahoo.com.au. A. is used as separator C:\windows\system32\d rivers\ A \ is used as separator
DNS Components: DNS Servers Resource Record in DNS Database DNS Name Resolution Approach
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) DNS: ROOT DNS Servers 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
DNS: TLD and Authorized 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
DNS: 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 at first acts as proxy, forwards query into hierarchy
DNS Resource Record DNS: distributed database storing resource records (RR) RR format: (name, ttl, class, type, value) TTL is a timing parameter IN class is widest used, means Internet There are multiple types (4 typical types) of RR records Everything after the type identifier is called value nic.keene.edu 3600 IN A 158.65.12.103 name ttl class type value
DNS Resource Record: 4 Typical Types r Type=A r Type=CNAME name is hostname value is IP address name is alias name for some canonical (the real) name Type=NS www.ibm.com is really name is domain (e.g. foo.com) servereast.backup2.ibm.com value is canonical name value is hostname of authoritative name server for this domain r Type=MX value is name of mailserver associated with name
DNS Record: Type A Record means the Address record Contains an IPv4 Address (the address computers use to uniquely identify each other on the internet) cs.keene.edu IN A 158.65.110.24 the record here defines the host uniquely identifiable as cs.keene.edu to be reachable at the IPv4 Address 158.65.110.24
Type A Record: an example cs.keene.edu IN A 158.65.110.24
DNS Record: Type CNAME Record A CNAME (canonical name) defines an alias The alias will then be resolved, if another CNAME is encountered then the process continues until an A record is found suncook.keene.edu IN A 158.65.2.147 www.keene.edu IN CNAME suncook.keene.edu defines the name uniquely identifiable as www.keene.edu to be and alias to suncook.keene.edu, i.e. both of them have the same IP
Type CNAME Record: an example suncook.keene.edu IN A 158.65.2.147 www.keene.edu IN CNAME suncook.keene.edu
DNS Record: Type MX Record An MX record defines the mail servers for a particular domain Mail exchange records hold the name of hosts, and their priorities, able to deliver mail for the domain. ksc.mailcruiser.com IN MX 5 mail.campuscruiser.com In the ksc.mailcruiser.com domain, defines the mail server mail.campuscruiser.com to be the priority 5 mail server for the ksc.mailcruiser.com domain.
Type MX Record: an example ksc.mailcruiser.com IN MX 5 mail.campuscruiser.com
DNS Record: Type NS Record An NS record defines the authoritative Name servers for the domain keene.edu IN NS nic.keene.edu defines the host nic.keene.edu to be a name sever for the domain keene.edu
Type NS Record: an example keene.edu IN NS nic.keene.edu
DNS name resolution: iterated query root DNS server Host at cs.keene.edu wants IP address for gaia.cs.umass.edu iterated query: r r contacted server replies with name of server to contact I don t know this name, but ask this server local DNS server nic.keene.edu 1 2 8 requesting host cs.keene.edu 3 4 5 7 TLD DNS server 6 authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu
DNS name resolution: recursive query root DNS server 2 3 recursive query: r puts burden of name resolution on contacted name server local DNS server nic.keene.edu 7 6 5 4 TLD DNS server 1 8 requesting host cs.keene.edu authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu
Thank you for your attendance Any questions?