Hostnames � IP Addresses are great for computers CSCE 515: � IP address includes information used for routing. Computer Network � IP addresses are tough for humans to remember. Programming � IP addresses are impossible to guess. ------ Address Conversion Function and DNS � ever guessed at the name of a WWW site? RFC 1034, RFC 1035 Wenyuan Xu � What if the server is moved to a different machine with a http://www.cse.sc.edu/~wyxu/csce515f07.html different address Department of Computer Science and Engineering � wyxu@cse.sc.edu University of South Carolina � wyxu@129.252.138.9 2007 CSCE515 – Computer Network Programming Once there was HOSTS.TXT HOSTS.TXT was a bottleneck � Centralized for all the host in ARPAnet � … too much traffic generated by the updates in both directions. � /etc/hosts were derived from HOSTS.TXT � It was maintained by NIC and distributed by a � Main problems: single host � traffic and load � name collision � The changes were e-mailed to NIC in one way � consistency and ftped on the other way once or twice a week � Internet started to grow up exponentially……. 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming Domain Name System (DNS) Hierarchical Organization of DNS � A distributed database used by TCP/IP applications to map between hostnames and IP addresses Unnamed root � No single site on Internet knows all information; each site maintains its own database and let other sites query it arpa com edu gov int mil net org ae us zw … … � Domain names comprise a hierarchy so that names are unique, yet easy to remember. United Arab Zimbabwe in-addr sc sc Emirates � Can you explain this in CS terms? 118 cse state � Postal system: 130 vega www � David on Main St. in White Plain, NY vega.cse.sc.edu www.state.sc.us � David on Main St. in Columbia, SC 252 Country Generic domains domains 129 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming
Host name structure Domain Name � Each host name is made up of a � The domain name for a host is the sequence of labels separated by sequence of labels that lead from the host periods. (leaf node in the naming tree) to the top of � Each label can be up to 63 characters the worldwide naming tree. � Do you know the char length limits of a total name? � A domain is a subtree of the worldwide � Examples: naming tree. � whitehouse.gov � barney.the.purple.dinosaur.com � vega.cse.sc.edu 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming Top level domains More on domain names � Generic: � Domain names can be either: � edu, gov, com, net, org, mil , … � absolute (ends with a period) � engr.sc.edu. � Countries each have a top level domain (2 letter � relative does not ends with a period. Relative domain name). names have to be interpreted in some context � cn, uk, it, zl, jp… to uniquely determine their true meaning. � New top level domains include: .aero .biz .coop .info .name .pro � Domain names are case insensitive � arpa , a special domain used for address-to- � edu, Edu, EDU are the same name mappings 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming What do the hosts within the same To get a new domain domain have in common? � To create a new domain, permission is required � Do they must have the same OS? of the domain in which it will be included. � Do they must belong to the same � company.com , get permission from whoever manage network? com � Do they must be administrated by the � cse.sc.edu , get permission from sc.edu same person? � They usually are logically related: � Can a machine inside computer science building � geographically close have a different domain? � same organization � Yes, Naming follows organizational boundaries, not � …. physical networks 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming
DNS Organization DNS Zone � Distributed Database � A subtree of DNS tree that is administered � The organization that owns a domain name separately is responsible for running a DNS server � Each zone contains name servers holding the that can provide the mapping between information about that zone. hostnames within the domain to IP Unnamed root addresses. � So - some machine run by SC is responsible for everything within the sc.edu arpa com edu gov int mil net org ae us zw … … domain. United Arab Zimbabwe in-addr sc sc Emirates 118 cse state 130 vega www 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming DNS Clients DNS Distributed Database � A DNS client is called a resolver . � Each zone has a primary name server and one or more secondary name server � To avoid single point of failure � A call to gethostbyname() is handled by � secondary servers containing replicated databases. a resolver (typically part of the client). sc.edu DNS server sc.edu � Most Unix workstations have the file sc.edu rpi.edu rpi.edu DNS DB /etc/resolv.conf that contains the DNS DB DNS DB DNS DB local domain and the addresses of DNS Authoritative Replicas servers for that domain. Can a name server for a zone located outside the zone? 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming /etc/resolv.conf nslookup � nslookup is an interactive resolver that domain cse.sc.edu allows the user to communicate directly 129.252.131.9 with a DNS server. 129.252.11.9 � nslookup is usually available on Unix workstations. ( dig and host are also DNS clients). 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming
DNS Servers DNS Servers (cont’d) � Servers handle requests for their domain directly. � When a new system is added to a zone, DNS administrator for the zone assigns a � Servers handle requests for other domains by contacting remote DNS server(s). name and an IP address and stores information in name server � When a name server is queried, it first searches its database � If found, reply with a DNS response message � If not found, contact external DNS servers � To resolve a name or address, client can send DNS query message to a name � A name server caches external mappings received to reduce DNS traffic server of its zone � Authoritative record � Cache record 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming Server - Server Communication The Root DNS Server � If a server is asked to provide the � The root server needs to know the mapping for a host outside it’s domain address of 1st (and many 2nd) level (and the mapping is not in the server domain nameservers. cache): � The server finds a nameserver for the target domain. edu com org jp � The server asks the nameserver to provide the host name to IP translation. � To find the right nameserver, use DNS! sc yale 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming Server Operation DNS Data � DNS databases contain more than just hostname-to-address � If a server has no clue about where to find records -- a set of resource records (five-tuple) the address for a hostname, ask the root � Domain Name: server. � Series of labels of alphanumeric characters or hyphens � Each pair separated by period � Time_to_live � The root server will tell you what � How long to hold the result in local cache � Class nameserver to contact. For internet information it is always IN � � Type � A request may get forwarded a few times. what kind of record this is � � Value � Description of resource � For A type, Rdata is 32-bit IP address Main function of DNS is to map domain names onto resource records! 2007 CSCE515 – Computer Network Programming 2007 CSCE515 – Computer Network Programming
Recommend
More recommend