Application Layer

2.5 DNS--The Internet's Directory Service

Home
Introduction
2.1 Principles of Network Applications
2.1.1 Network Application Architectures
2.1.2 Processes Communcating
2.1.3 Application-Layer Protocols
2.1.4 What Services Does an Application Need?
2.1.5 Services Provided by the Internet Transport Protocols
2.2 The Web and HTTP
2.2.1Overview of HTTP
2.2.2 Nonpersistent and Persistent Connections
2.2.3 HTTP Message Format
2.2.4 User-Server Ineraction: Cookies
2.2.5 HTTP Content
2.2.6 Web Caching
2.2.7 The Conditional GET
2.3 File Transfer: FTP
2.3.1 FTP Commands and Replies
2.4 Electronic Mail in the Internet
2.4.1 STMP
2.4.2 Comparison with HTTP
2.4.3 Mail Message Formats and MIME
2.4.4 Mail Access Protocols
2.5 DNS--The Internet's Directory Service
2.5.1 Services Provided by DNS
2.5.2 Overview of How DNS Works
2.5.3 DNS Records and Messages
2.6 P2P File Sharing
2.7 Socket Programming with TCP
2.7.1 Socket Programming with TCP
2.7.2 An Example Client/Server Application in Java
2.8 Socket Programming with UDP

2.5.3 DNS Records and Messages

The DNS servers that together implement the DNS distributed database store resource records (RR), including RRs that provide hostname-to-IP address mappings.  Each DNS reply messge carries one or more resource records. 
 
TTL si the time to live of the reosurce record; it determines when a resource should be removed from a cache. 
 
If a DNS server is authoritative for a particualr hostname, then the DNS server will contain a Type A record for the hostname.  If a server is not authoritative for a hostname, then the server will contain a Type NS record for the domain that includes the haostname; it will also contain a Type A record that porvides the IP address of the DNS server in the Value field of the NS record.
 
DNS Messages
These are the only two kinds of DNS messges.  The semantics of the various fields in a DNS message are as follows:
  • The first 12 bytes is the header section, which has a number of fields.  The first field is a 16-bit number that identifies the query.  The identifier is copied into the reply message to a query, allowing the client to match received replies with sent queries.
  • The question section contains information about the query that is being made.  This section includes (1) a name field that contains the name that is being queried, and (2) a type field that indicates the type of question being asked about the name.
  • In a reply from a DNS server, the answer section contains the resource records for the name that was originally queried.  Recall that in each resource record there is the Type, the Value, and the TTL.
  • The authority section contains records of other authoritative servers.
  • The additional section contains other helpful records.  The answer filed in a reply to an MX query contains a resource record providing the canonical hostname of a mail server.

Inserting Records into the DNS Database

You might be wondering how records get into the database in the frist place.  Suppose you have just created an exciting new startup company.  The first thing yo'll surely want to do is register the domain name at a registrar.  A registrar is a commercial entity that verifies the uniqueness of the domain mane, enters the domain name into the DNS database and collects a small fee from you for its services.

When you register the domain name with some resistrar, you also need to provide the registrar with the names and IP addrsses of your primary and secondary authoritative DNS servers.  For the primary authoritative server the registrar would insert into the DNS system the following two resource records.

You'll also have to make sure that the Tpye A resource record for your Web server and the Type MX resource record for your mail server are entered into your authoritative DNS servers.

Once all of these steps are completed, people will be able to visit your Web site and send e-mail to the employees at your company.

 

kurose_320719_c02f22.gif