Linux Nameserver Notes


The simplest way, which takes no advantage of the way the name space has 
been split up into zones is a host table stored in /etc/hosts.

Alternatively, you may use BIND-- the Berkeley Internet Name Domain Service
To run named, simply enter 
/usr/sbin/named 
at the prompt. named will come up, read the named.boot file and any zone
files specified therein. It writes its process id to /var/run/named.pid 
in ASCII, downloads any zone files from primary servers, if necessary,
and starts listening on port 53 for DNS queries. 

The central file that controls your resolver setup is host.conf. It resides 
in /etc and tells the resolver which services to use, and in what order. 

	# /etc/host.conf
	# We have named running, but no NIS (yet)
order   bind hosts
	# Allow multiple addrs
multi   on
	# Guard against spoof attempts
nospoof on
	# Trim local domain (not really necessary).
trim    vbrew.com.

Configuring Name Server Lookups-- resolv.conf
	# /etc/resolv.conf
	# Our domain
domain         vbrew.com
	#
	# We use vlager as central nameserver:
nameserver     191.72.1.1

When resolving the name vale, the resolver would look up vale,
and failing this, vale.vbrew.com, and vale.com 

To run named, simply enter 

	# /usr/sbin/named

The named.boot file for vlager. 

;
; /etc/named.boot file for vlager.vbrew.com
;
directory     /var/named
;
;             domain                   file
;---------------------------------------------------
cache         .                        named.ca
primary       vbrew.com                named.hosts
primary       0.0.127.in-addr.arpa     named.local
primary       72.191.in-addr.arpa      named.rev
named.ca file. 

;
; /var/named/named.ca          Cache file for the brewery.
;                We're not on the Internet, so we don't need
;                any root servers. To activate these
;                records, remove the semicolons.
;
; .                99999999   IN    NS  NS.NIC.DDN.MIL
; NS.NIC.DDN.MIL   99999999   IN    A   26.3.0.103
; .                99999999   IN    NS  NS.NASA.GOV
; NS.NASA.GOV      99999999   IN    A   128.102.16.10

named.hosts file. 

;
; /var/named/named.hosts       Local hosts at the brewery
;                               Origin is vbrew.com
;
@                   IN  SOA   vlager.vbrew.com. (
janet.vbrew.com.
16         ; serial
86400      ; refresh: once per day
3600       ; retry:   one hour
3600000    ; expire:  42 days
604800     ; minimum: 1 week
)
IN  NS    vlager.vbrew.com.
;named.local file. 

;
; /var/named/named.local       Reverse mapping of 127.0.0
;                               Origin is 0.0.127.in-addr.arpa.
;
@                   IN  SOA   vlager.vbrew.com. (
joe.vbrew.com.
1          ; serial
360000     ; refresh: 100 hrs
3600       ; retry:   one hour
3600000    ; expire:  42 days
360000     ; minimum: 100 hrs
)
IN  NS    vlager.vbrew.com.
1                   IN  PTR   localhost.named.rev file 

;
; /var/named/named.rev         Reverse mapping of our IP addresses
;                               Origin is 72.191.in-addr.arpa.
;
@                   IN  SOA   vlager.vbrew.com. (
joe.vbrew.com.
16         ; serial
86400      ; refresh: once per day
3600       ; retry:   one hour
3600000    ; expire:  42 days
604800     ; minimum: 1 week
)
IN  NS    vlager.vbrew.com.
; brewery

There's a fine tool for checking the operation of your name
 server setup. It is called nslookup.