170 likes | 281 Views
24. DNS. Domain Name System. resolve. map. 24.2 Mapping Domain Names To Address. http://www.voa.gov IP address 1. Name server domain name IP address ftp.cs.mit.edu xx.xx.xx.xx. Name server has :
E N D
24. DNS Domain Name System
resolve map 24.2 Mapping Domain Names To Address http://www.voa.gov IP address 1. Name server domain name IP address ftp.cs.mit.edu xx.xx.xx.xx
Name server has: • domain name database which contains domain names and its IP addresses for all computers in the domain • information about locations of some name servers, such as root name server • Distributed processing: a set of servers operating at multiple sites solve the mapping cooperatively
root ... …... ….. cn jp ... …... com us edu ... …... ... com com edu edu MIT cm …... pku ustc nju ftp.cs.mit.edu
Links among name servers • a single server is responsible for all computers that have a given suffix nju name server --- *. nju.edu.cn edu name server --- *. edu.cn • each server knows the location of a root server • each server knows the locations of servers of subparts of the hierarchy
name server IP address name IP address type www.nju.edn.cn 202.119.32.6 A netra.nju.edu.cn 202.119.32.8 MX cs.nju.edn.cn 202.119.36.5 A localhost 127.0.0.1 A …… …… …??... nju DNS DB nju resolve nameserver IP1 names.edu.cn IP i …… ...
name IP address type www.edu.cn IP I A …… …… …... edu.cn DNS DB edu.cn resolve name server IP address nameserver IP1 names.tsinghua.edu.cn IP2 names.pku.edu.cn IP3 names.nju.edu.cn IP4 …… …...
ftp.cs.mit.edu IP address 2. Domain name resolution S C 54 Client (user machine) : • must know at least one name server, usually a local name server --- set “DNS sever” • has a name resolver --- gethostbyname( ) name resolver name server
Basic idea: Given a name to resolve, the root can choose the correct server for that name because the root knows which server resolves each domain. ftp.cs.mit.edu www.pku.edu.cn lxn@cis.uoguelph.ca
Two-step name resolution: • When a domain name server receives a query, it checks its DNS database. If it finds the name, it returns the result • If the name server can not resolve the name, the server contacts other domain name servers
root cn edu edu MIT nju Iterative resolution www.mit.edu Recursive resolution
Two ways to use DNS: • Iterative resolution: by contacting name servers one at a time • Recursive resolution: by asking the name server system to perform a complete translation (resolution)
www.mit.edu edu’ DNS IP addr. gethostbyname( ) www.mit.edu www.mit.edu www.mit.edu mit.edu’ DNS IP addr. edu’ DNS IP addr. Resolving a name: S S C www.mit.edu 54 54 • name resolver nju DNS server • nju DNS server root DNS server • nju DNS server edu DNS server nju DNS server Root DNS server
root cn edu edu MIT nju www.mit.edu Recursive resolution?
root cn edu edu MIT nju Why not?
root cn edu edu MIT nju Iterative resolution
3. Optimization for domain name resolution • Caching • each server maintains a cache of recently used names as well as a record of where the mapping information for that name was obtained . Each name has a timer • host downloads DNS database from a local domain name server, maintains its own cache. • Replicating root server 13 servers