Domain Name System: DNS Objective: map names to IP addresses (i.e., high level names to low level names) Original namespace was flat, didn t scale.. Hierarchical naming permits decentralization by delegating authority for parts of the namespace. Scalability and performance advantages Administrative benefits DNS is an example of a large scale client-server application. 1
2 DNS uses the Domain Name Space Names are defined in an inverted tree structure with the root at the top. The tree can have up to 128 levels Each node in the tree has a domain name which is a sequence of labels (each a max of 63 characters) separated by a.. The root node has a label of the null string If a domain name is terminated by the null string it is a fully qualified domain name A Domain is a subtree of the Domain Name Space
Internet Domain Names System Managing organizations : IANA, ICANN, INTERNIC 3
Mapping Domain Names to addresses Example: web browsing from a host on clemson.edu, what happens when you access www.mit.edu? 4
5 Key concepts Caching: When a local name server resolves a query, it is likely that another nearby Host will need the same name mapping. Therefore, a local name server cache s the entry for an amount of time specified by the time to live (TTL) field in the query-response. Iterative versus recursive queries: When a host issues a query to a name server it has two choices: Iterative request simply asks the NS if it can resolve the name. If it can t, the Host will do the next step. Recursive query asks the NS to resolve the name, even if the name is not in its cache.
6 Host asks local server to resolve www.mit.edu by sending a DNS query message. 3 possibilities local NS has it cached and returns a non-authoritative resource record (RR), if the local NS did not have the name cached: And if the client asked for an iterative resolution the local NS returns a Name Server (NS) resource record. And if the client asked for a recursive solution the local NS returns the resolved name. Local NS sends a query to a root server which might return a referral pointing to the.edu server. The local NS sends a query to the.edu server which might return a referral pointing to the MIT NS. Finally, the local NS queries the.mit.edu server which returns an A record (the 32 bit IP address)
7 DNS query/reply protocol (UDP!!!!) Host asks a NS to resolve an IP address with one of two types of requests: Type A: The Host wishes to translate from www.clemson.edu to the 32 bit binary Address. Type PTR: The Host wishes to translate from an address in dotted decimal into a DNS name (i.e., an Inverse Query). Responses called Resource Records: The NS might return: The translated address A referral to another NS that can give an authoritative reply to the query An error
Dig tool : interact with DNS jmarty@blade2[241] dig www.clemson.edu ; <<>> DiG 8.3 <<>> www.clemson.edu ;; res options: init recurs defnam dnsrch ;; got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUERY SECTION: ;; www.clemson.edu, type = A, class = IN Query message sent by the resolver running on blade2 ;; ANSWER SECTION: www.clemson.edu. 1d5h56m12s IN A 130.127.69.228 8 ;; AUTHORITY SECTION: clemson.edu. 19h28m25s IN NS ns2.tamu.edu. clemson.edu. 19h28m25s IN NS hubcap.clemson.edu. clemson.edu. 19h28m25s IN NS ra.ces.clemson.edu. ;; ADDITIONAL SECTION: ra.ces.clemson.edu. 15m28s IN A 130.127.200.5 ns2.tamu.edu. 5h47m46s IN A 128.194.254.5 hubcap.clemson.edu. 2h32m50s IN A 130.127.28.32 ;; Total query time: 8 msec ;; FROM: blade2.cs.clemson.edu to SERVER: default -- 130.127.48.3 ;; WHEN: Wed Mar 29 10:53:22 2006 ;; MSG SIZE sent: 33 rcvd: 162 Query reply message generated by a clemson name server The ra flag indicates that the reply is authoritative
DNS program support Local host resolver is the client code running at the host. All hosts must know either their local NS or the root NS. The local resolver handles appreviatons. On Unix, /etc/resolv.conf tells the resolver the name server and the default domain Programming interface through sockets: GetHostByName(), GetHostByAddr() 9
Domain name registration services? Domain hosting?? 10