DNS: BIND named Server Types

DNS Server Config
DNS Zone Files 1
Types of DNS Servers

DNS servers do not always fit into strict categories. For example, a server may be master for one domain and slave for another. However, it is easier to understand the basic types.

4 basic types of DNS servers
  • Master DNS server, which is authoritative for at least one domain, including host records for that domain(s)
  • Slave DNS server, relies on master for data, can be used by clients in place of the master
  • Forwarding-only DNS server: refers all requests to other DNS servers. 
  • Caching-only DNS server: stores recent requests. If configured with forwarding features, it refers to other DNS servers for requests not in its cache.

Master
A nameserver master gets its zone data from a local file system. A nameserver is designated as master by including 'type master' in the zone declaration section of the named.conf file.

zone "petervtamas.com" in{
type master;
file "db.petervtamas.com";
};

Clients should not query nameserver masters.

Slave
Slave nameservers pull data from master in a process called a zone transfer. Most nameservers are either primary master or a slave for most of the zones they load.

zone "example.com" in{
      type slave;
      file "db.petervtamas.com";
      masters {192.168.23.17;};
};

Clients can be configured to query slave nameservers. Or, clients may be configured to query caching-only or forwarding-only nameservers, which in turn query the slave nameservers when the result is not already in their cache.

Caching-only
Caching-only nameservers improve performance by storing the results from name queries. This is particularly helpful when querying external nameservers, which are slower to respond. Client machines are pointed to caching-only nameservers rather than the slave nameservers.

The caching-only nameservers figure out the answer to queries by recursively querying authoritative DNS servers for the appropriate domains. (For this reason, caching-only nameservers are sometimes known as resolvers, but a DNS client is also often called a resolver).  If data is obtained from a zone master, the caching-only will respond as authoritative and the data is cached. When data is supplied from cache, the response will be non-authoritative.

Sample settings in /etc/named for a caching-only name server.

// recursion yes is the default and may be omitted
options {
directory "/var/named";
version "not currently available";
recursion yes;
};

// the DOT indicates the root domain = all domains
zone "." IN {
type hint;
file "root.servers";
};


Forwarding nameserver
A forwarding nameserver differs from a caching nameserver by not making recursive queries itself but forwarding them to other nameservers. This is less work for the nameserver. A forwarding nameserver can forward queries to different servers, for example external queries to one nameserver and internal queries to another.

A forwarding nameserver can cache responses.


Suggestions for Future Learning

The official BIND web site is:
also:



DNS bind name server

DNS Server Config
DNS Zone Files 1
This article describes BIND (DNS)  administration and is intended for experienced UNIX administrators. Go to these tutorials on DNS Queries   or DNS settings for more introductory information.