Last updated Dec 19 2002
DNS
Domain Name Service (or System)

BIND



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:
/etc/nsswitch.conf
/etc/resolv.conf
/etc/hosts
/etc/host.conf


/etc/nsswitch.conf

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



/etc/resolv.conf

Directives(headers):
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.
Example:
nameserver    192.168.10.45
domain             lab.ts



/etc/hosts

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

127.0.0.1    localhost



/etc/host.conf

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:

named
named.conf
rndc  -  Remote Name server control utility
rndc.conf


named.conf

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

Contents:
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 {
192.168.10.45;
};
};


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