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.