Home
Knowledge Base
Credits
Site Map
 


DNS Records and Messages


DNS Records

The DNS servers that together implement the DNS distributed database store resource records

Each resource record contains 4 fields: Name, Value, Type, TTL

TTL stands for the time to live of the resource record; it determines when a resource should be removed from a cache

The meaning of Name and Value depend on Type

  • If Type = A, then Name is a hostname and Value is the IP address for
    the hostname; this record type provides the standard hostname to IP address
    mapping
  • If Type = NS, then Nane is a domain and Value is the hostname of an authoritative
    DNS server that knows how to obtain the IP addresses for hosts in the domain; this record type is used to route DNS queries further along in the query chain
  • If Type = CNAME, then Value is the canonical hostname for the alias
    hostname Name
  • If Type = MX, then Value is the canonical name of a mail server that
    has an alias hostname Name; MX records allow the hostnames of mail servers to
    have simple aliases

 



 

DNS Messages

There are only two types: query and reply

Both have the same format

 

 

The first 12 bytes is the header section

Parts of the header section

  1. Identification Field
    1. 16-bit number that identifies the query
    2. Identifier is copied into the reply message to a query, allowing the client to
      match received replies with sent queries
  2. Flag field
    1. 1-bit query/reply flag indicates whether the message is a query (0) or a
      reply (1)
    2. 1-bit authoritative flag is set in a reply message when a DNS server is an
      authoritative server for a queried name
    3. 1-bit recursion-desired flag is set when a client desires that the DNS server
      perform recursion when it doesn't have the record
    4. 1-bit recursion-available flag is set in a reply if the DNS server supports
      recursion
  3. 4 number-of fields
    1. Indicate the number of occurrences of the four types of data sections that
      follow the header

The question section contains information about the query that is being made

Parts of the question section

  1. A name field that contains the name that is being queried
  2. A type field that indicates the type of question being asked about the name

The answer section contains the resource records for the name that was
originally queried
A reply can return multiple RRs in the answer, since a hostname can have multiple IP addresses

The authority section contains records of other authoritative servers

The additional section contains other helpful records

Nslookup program allows you to to send a DNS query message directly from the local host to any DNS server (root, TLD, or authoritative)
After receiving the reply message from the DNS server, nslookup will display the records included in the reply (in human readable format)
This can also be accomplished from web sites that allow you to remotely employ mslookup

Inserting Records into the DNS Database

  • Register your domain name with a registrar
    • Registrar - a commercial entity that verifies the uniqueness of the domain
      name, enters the domain name into the DNS database, and collects a small
      fee from you for its services
    • There are many registrars competing for customers, and the Internet Corporation for Assigned Names and Numbers (ICANN) accredits the
      various registrars
  • Provide the registrar with the names and IP addresses or your primary and
    secondary authoritative DNS servers
  • Ther registrar ensures that a type NS and a type A record are entered into the TLD
    com servers
  • You will have to make sure that the type A resource record for your Web server and
    the type MX resourse record for your mail server are entered into your
    authoritative DNS servers

Once these steps are completed, people can visit your site and send email to your domain name