26
Raj Jain The Ohio State University 24-1 The Domain Name System The Domain Name System (DNS) (DNS) Raj Jain The Ohio State University Columbus, OH 43210 [email protected] http://www.cis.ohio-state.edu/~jain/

dns

Embed Size (px)

DESCRIPTION

dns

Citation preview

Raj Jain The Ohio State University24-1The Domain Name SystemThe Domain Name System(DNS)(DNS)Raj JainThe Ohio State UniversityColumbus, OH [email protected]://www.cis.ohio-state.edu/~jain/Raj Jain The Ohio State University24-2K Naming hierarchyK Server hierarchyK Name resolutionK Other information in name serversOverviewRaj Jain The Ohio State University24-3Why Names?Why Names?K Computers use addressesK Humans cannot remember IP addresses Need namesExample, Liberia for 164.107.51.28K Simplest Solution: Each computer has a unique nameand has a built in table of name to address translationK Problem: Not scalableK Solution: DNS (Adopted in 1983)K Hierarchical Names: Liberia.cis.ohio-state.eduRaj Jain The Ohio State University24-4Name HierarchyName Hierarchyrestoncom edu gov au usdec ohio-state nsf co vacis netlab eecnriUnnamed root...Raj Jain The Ohio State University24-5Name HierarchyName HierarchyK Unique domain suffix is assigned by InternetAuthorityK The domain administrator has complete control overthe domainK No limit on number of subdomains or number oflevelsK computer.site.division.company.comK computer.site.subdivision.division.company.comK Domains within an organization do not have to beuniform in number of subdomains or levelsRaj Jain The Ohio State University24-6Name Hierarchy (Cont)Name Hierarchy (Cont)K Name space is not related to physical interconnection,e.g., math.ohio-state and cis.ohio-state could be on thesame floor or in different citiesK Geographical hierarchy is also allowed, e.g.,cnri.reston.va.usK A name could be a subdomain or an individual objectRaj Jain The Ohio State University24-7Top Level DomainsTop Level DomainsDomain Name Assignmentcom Commercialedu Educationalgov Governmentmil Militarynet Networkorg Other organizationsarpa Advanced Research Project Agencycountry code au, uk, caRaj Jain The Ohio State University24-8Server HierarchyServer Hierarchypeanut almond walnutcandysoapfoobarcompeanut almond walnutcandysoapfoobarcomRaj Jain The Ohio State University24-9Server Hierarchy (Cont)Server Hierarchy (Cont)K Servers are organized in a hierarchyK Each server has an authority over a part of the naminghierarchyK The server does not need to keep all names.K It needs to know other servers who are responsible forother subdomainsK Contiguous space A single node in the naming treecannot be splitK A given level of hierarchy can be partitioned intomultiple serversRaj Jain The Ohio State University24-10Server Hierarchy (Cont)Server Hierarchy (Cont)K Authority has the name to address translation tableK Responsible Either has the name to addresstranslation table or knows the server who hasK A single server can serve multiple domains, e.g.,purdue.edu and laf.in.usK Root server knows about servers for top-leveldomains, e.g., comK Each server knows the root serverRaj Jain The Ohio State University24-11Server Hierarchy: ExampleServer Hierarchy: ExampleServerfor comServerfor eduServerfor govServerfor auServerfor usServer for dec.comServerfor osu.eduServer fornsf.govserver forco.auServer forva.usRootServerRaj Jain The Ohio State University24-12Server Hierarchy: BetterServer Hierarchy: BetterK Fewer serversServer for dec.comServerfor osu.eduServer fornsf.govserver forco.auServer forva.usRootServerRaj Jain The Ohio State University24-13Name ResolutionName ResolutionUserNameResolverNameServerNameServerCache CacheCacheQueryResponseQueryResponseQueryResponseData-baseData-baseNameServerCacheData-baseQueryResponseRaj Jain The Ohio State University24-14Name Resolution (Cont)Name Resolution (Cont)UserNameResolverNameServerNameServerCache CacheCacheQueryReferralQueryResponseQueryResponseData-baseData-baseNameServerCacheData-baseQueryResponseRaj Jain The Ohio State University24-15Name Resolution (Cont)Name Resolution (Cont)K Each computer has a name resolver routine, e.g.,gethostbyname in UNIXK Each resolver knows the name of a local DNS serverK Resolver sends a DNS request to the serverK DNS server either gives the answer, forwards therequest to another server, or gives a referralK Referral = Next server to whom request should be sentRaj Jain The Ohio State University24-16Name Resolution (Cont)Name Resolution (Cont)K Resolvers use UDP (single name)or TCP (whole group of names)K Knowing the address of the root server is sufficientK Recursive Query:Give me an answer (Don't give me a referral)K Iterative Query:Give me an answer or a referral to the next serverK Resolvers use recursive query.K Servers use iterative query.Raj Jain The Ohio State University24-17DNS OptimizationDNS OptimizationK Spatial Locality: Local computers referenced moreoften than remoteK Temporal Locality: Same set of domains referencedrepeatedly CachingK Each entry has a time to live (TTL)K Replication: Multiple servers. Multiple roots.Ask the geographically closest server.Raj Jain The Ohio State University24-18AbbreviationsAbbreviationsK Servers respond to a full name onlyK However, humans may specify only a partial nameK Resolvers may fill in the rest of the suffix, e.g.,Liberia.cis = Liberia.cis.ohio-state.eduK Each resolver has a list of suffixes to tryRaj Jain The Ohio State University24-19DNS Message FormatDNS Message FormatNumber of Authority Number of AdditionalQuestion Section...Answer Section...Authority Section...Additional Information Section...Number of Questions Number of AnswersIdentification ParameterRaj Jain The Ohio State University24-20Format (Cont)Format (Cont)K Format of the query section entries:K Format of other section entries:Query Type Query ClassQuery Domain Name...Time to live Resource Data LengthResource Domain NameType ClassResource DataRaj Jain The Ohio State University24-21DNS Message FormatDNS Message FormatK Length = 0 End of names. Length < 64Two msbs (most significant bits) = 11 PointerK Resource data contains serial (version) number of thezone, refresh interval, retry interval, expiry interval,mailbox of the responsible person, etc.Raj Jain The Ohio State University24-22DNS Message Format (Cont)DNS Message Format (Cont)Bit Meaning0 Operation: 0=Query, 1=Response1-4 Query type: 0=Standard, 1=Inverse, 2,3obsolete5 Set if answer authoritative6 Set if message truncated7 Set if recursion desired8 Set if recursion available9-11 Reserved12-15 Response type: 0=No error, 1=Format error,2=Server Failure, 3=Name does not existRaj Jain The Ohio State University24-23Inverse MappingInverse MappingK Given an address, what is the name?K nnn.nnn.nnn.nnn.in-addr.arpaRaj Jain The Ohio State University24-24Types of DNS EntriesTypes of DNS EntriesK DNS is used not just for name to address resolutionK But also for finding mail server, pop server,responsible person, etc for a computerK DNS database has multiple typesK Record type A Address of XK Record type MX Mail exchanger of XK CNAME entry = Alias name (like a file link), "seename"K www.foobar.com = hobbes.foobar.comRaj Jain The Ohio State University24-25Resource Record TypesResource Record TypesType MeaningA Host AddressCNAME Canonical Name (alias)HINFO CPU and O/SMINFO Mailbox InfoMX Mail ExchangerNS Authoritative name server for a domainPTR Pointer to a domain name (link)RP Responsible personSOA Start of zone authority (Which part ofnaming hierarchy implemented)TXT Arbitrary TextRaj Jain The Ohio State University24-26SummarySummaryK DNS: Maps names to addressesK Names are hierarchical. Administration is alsohierarchical.K No standard for number of levelsK Replication and caching is used for performanceoptimization.