Make your own free website on
Last updated Dec 19 2002
Domain Name Service (or System)


DNS is a tree structured system.  The top is written as "." and pronounced "root".  Under "." are the TDL's (Top Level Domain) like org, com, edu, net, etc...
When we request a name that is not in our cache the TDL's are contacted.  They refer you to the DNS server for the next (from the right) branch which will point you to the next DNS server for the next branch until you get your answer.

DNS Client - Resolver
To be a DNS client a machine must have a resolver.  Niether a daemon nor a single program, it is a set of dynamic library routines used by applications to query the name server.  To enable the resolver make an entry in /etc/nsswitch.conf that point to DNS.  (see /etc/nsswitch.conf farther down the page)

Two types of clients:
client only - doesn't run named
Client server - does run named

DNS files:


Name service switch configuration file.
Used to identify which databases to use when looking for information on hosts, users, & groups.
Look in /etc/nsswitch for "hosts".  The following line will look at the file /etc/hosts for a name and if it can't find it there it will querey the dns server.

hosts:  files  dns


nameserver  -  IP address in dot notation of the name server the resolver should use.
domain  -  The local domain name.  For use with short names in a local domain.
search  -  search list for hostname lookup.  Use local doamin name.
Note:  Can't use domain and search at the same time.
domain             lab.ts


Text file used for host to IP address resolution.  Should have localhost, local IP and name, and any others you may want.    localhost


order    bind,hosts,nis   # order to search a name (how does this effect nsswitch.conf?)
multi    on    # [on/off]  Show all IP's in /etc/hosts for a given name instead of just the first match.

(more do a man)

BIND files:

rndc  -  Remote Name server control utility


BIND uses named.conf as its configuration file.  It is read everytime named runs.

options {
directory "/etc/namedb";
The above lines tell named where to look for its files.  I have also seen it as "/var/named".
The below lines tell named the type and name of the zone files.  The zone "." is the root domain.  The file "named.root" has the pointers to the root name servers.  Severs change over time.  This file must be maintained.

zone "." {
type hint;
file "named.root";
zone "lab.ts" {
type master;
file "lab.ts";

Forwarding.  Used in large networks to lower work load on a server.  Set up your DNS server to forward request to the primary DNS server on your network.  The cache on the new server will fill up removing traffic from the primary.

options {
forward first;
forwarders {;

Important domain.  allows us to get the host's name when we have the address.  It is written in reverse.