DNS Domain Name Service america.pcs.cnu.edu->
BIND an implementation of DNS A resolver for the client –libraries linked into client code A server NAMED Database files with the mapping Client App Resolver libraryNamed Database
But it’s a little more complicated The client asks the server Server sometimes has to ask other servers for answers Each domain (pcs…) has responsibility for its own machines Client Server pcs.cnu.edu Internet
A Distributed System The internet has a collection of servers Each domain takes care of its own If a server can’t find the IP address, it either directly asks or forwards the request to a server which helps. Redundancy is important You design your server approach Physical location of server in domain is NOT required
Domains (root) edugov mil com others cnuodu wm pcs isl math Domains can delegate responsibility for some of the domain to others
Types of servers Resolver Only (NO server on client machine Primary Secondary –gets info from primary Caching only (slave) –only caches what it retrieves –does not get updates from servers
A typical design Internet primary secondary slave
Configuring the client (resolver) Every machine is a client The process of looking up a name is configured in a file : resolv.conf Tells the library linked into your code –how to search for names ( domain entries) –where to look for names( nameserver entries) domain pcs.cnu.edu nameserver nameserver Example resolv.conf
domain entry Unix% telnet sappho What is the IP of this machine? domain pcs.cnu.edu nameserver nameserver RESOLVER server Find the IP of sappho.pcs.cnu.edu. A user types this NOTE: multiple domains can be listed (add cnu.edu )
nameserver entry domain pcs.cnu.edu nameserver nameserver RESOLVER First ask what the IP is Second ask what the IP is if there is no answer from Windows has the same info in network/TCPIP/properties
That’s it for the client! Two entries in resolv.conf Now for the server! Lots more options More types of servers
Servers and domains cnu.edu pcs.cnu.edu america sappho drake wm.edu bio.wm.edu BioNs frogs WmNs rootserver edu sappho wants to contact frogs.bio.wm.edu 1-sappho asks its nameserver (america.. from resolv.conf) 2-america doesn’t know so asks rootserver from cache 3- rootserver knows only knows.edu and forwards request 4- edu server responds to america with an answer for wm.edu 5-america contacts wm.edu nameserver WmNs which has delegated a subdomain to BioNs 6- WmNs contacts nameserver BioNs to which is the nameserver for bio.wm.edu 7- BioNs responds to WmNs with the IP for frogs 8- WmNs responds to america with the IP for frogs 9- america responds to sappho with the IP for frogs. As responses are generated, names and servers are cached for subsequent use. E.g. 6-7 could be bypassed if WmNs has already asked BioNs about frogs
Queries nameserver entry directs the request Servers can be set up to forward requests or to go directly to rootservers (america bypasses drake in this example) General approach is to resolve from the top Results are cached for future use Nameservers are not always physically located in the domain they serve
Major files at a server Named.boot –tells the server (named) where its data is stored and for which domains it has responsibility as the primary server Database files –primary has THE copy of mappings –secondary is told where to get copies and where to store them
named.boot directory /whatever (/etc/named) primary localhost localhost primary IN-ADDR.ARPA localrev.dns cache. cache Caching only directory /whatever (/etc/named) primary pcs.cnu.edu pcs.dns primary IN-ADDR.ARPA pcsrev.dns primary localhost localhost primary IN-ADDR.ARPA localrev.dns cache. cache Primary (for pcs net) (assume at ) directory /whatever (/etc/named) primary wm.edu wm.dns primary IN-ADDR.ARPA wmrev.dns secondary pcs.cnu.edu pcs.dns secondary IN-ADDR.ARPA pcsrev.dns primary localhost localhost primary IN-ADDR.ARPA localrev.dns cache. cache Secondary (for pcs but could be located anywhere! ) Primary for wm.edu
Primary named.boot directory /whatever (/etc/named) primary pcs.cnu.edu pcs.dns primary IN-ADDR.ARPA pcsrev.dns primary localhost localhost primary IN-ADDR.ARPA localrev.dns cache. cache Primary (for pcs net) (assume at ) This server stores files in /whatever directory usually someplace in /etc like /etc/named Primary server for pcs.cnu.edu and stores THE database for that domain in /whatever/pcs.dns Name(pcs.dns) is not important All servers take of this for their self Reverse dns for the pcs domain Reverse dns for the loopback Cache initialization starts out with rootservers stored in /whatever/cache
Secondary named.boot directory /whatever (/etc/named) primary wm.edu wm.dns primary IN-ADDR.ARPA wmrev.dns secondary pcs.cnu.edu pcs.dns secondary IN-ADDR.ARPA pcsrev.dns primary localhost localhost primary IN-ADDR.ARPA localrev.dns cache. cache Secondary (for pcs but could be located anywhere! ) Primary for wm.edu Primary server for wm.edu with database in wm.dns Reverse dns for wm.edu which is in subnet Secondary dns for pcs.cnu.edu gets files from which is the primary server for that domain Secondary reverse dns for pcs domain
Root servers Initialize your cache with root servers..done periodically update the list via ftp from –ftp site nic.ddn.mil –file netinfo/root-servers.txt IN NS TERP.UMD.EDU IN NS AOS.BRL.MIL IN NS C.NYSER.NET IN NS A.ISI.EDU. TERP.UMD.EDU IN A AOS.BRL.MIL IN A C.NYSER.NET IN A A.ISI.EDU IN A AND OTHERS..
DNS Server Database entries An example for localhost for sappho is used to indicate the domain is the same as ORIGIN ; ORIGIN defined in named.boot for each domain ; here it would be IN SOA localhost. dgame.pcs.cnu.edu. ( 1 ; serial or version # change w/mods ; refresh every 100 hours 3600 ; retry after 1 hour ; expire after 1000 hours ; default ttl is 100 hours ) IN NS localhost. IN A
Simple server db file ; ORIGIN for this should be defined as IN SOA america.pcs.cnu.edu. root.pcs.cnu.edu. ( ( 10000, 43000, 3600, , ) ; nameservers IN NS america.pcs.cnu.edu. ; NOTE. On end isl IN NS xyz.isl.pcs.cnu.edu. ; delegates subdomain to isl ; name server Ips xyz.isl.pcs.cnu.edu. IN A america.pcs.cnu.edu. IN A sappho IN A endeavor IN A …. ; mail server IN MX 5 mail.pcs.cnu.edu. ;5 is priority ; define mail server mail IN A
Reverse DNS > sappho.pcs.cnu.edu Exists within the DNS system com edu cnuwm arpa in-addr (db file)
Reverse DNS example db file ; reverse dns for $ORIGIN SOA drake.cnu.edu. root.cnu.edu. ( ) IN NS drake.cnu.edu. ; found through normal dns 2 IN NS america.pcs.cnu.edu IN PTR drake.pcs.cnu.edu IN PTR pompeii.pcs.cnu.edu > pompeii > drake Example server for cnu.edu (delegate subnet 2) ; reverse dns for $ORIGIN SOA america.pcs.cnu.edu. root.pcs.cnu.edu. ( ) IN NS america.pcs.cnu.edu. 20 IN PTR sappho.pcs.cnu.edu. 21 IN PTR endeavor.pcs.cnu.edu. Example server for pcs.cnu.edu (delegated subnet 2) > endeavor > sappho
How are these started? named is in one of your startup scripts –reads basic configuration information from named.boot –reads all of the data base files or contacts the primary servers resolver does not “start” –part of your application code –checks resolv.conf when application runs resolver and named create BIND system
Checking it out with nslookup An interactive program to let you check configuration Available on unix Responds with server used and response Can set type of responses requested You can control which server is used Try the exercise on-line at –