Setting Up a Caching-Only Name Server

Setting up a caching-only name server is fun and easy. Well it's easy. All you need to do is install 3 configuration files, make a simple change to your resolver configuration file, and start the name server program.


Configuration Files

/etc/named.boot

;
; named.boot - caching name server configuration file for BIND version 4
;
directory /etc
;
cache           .                       named.ca
primary         0.0.127.in-addr.arpa    named.local

/etc/named.conf

//
// named.conf - caching name server configuration file for BIND version 8
//

options {
	directory  "/etc";
        host-statistics no;
	fake-iquery no;
};

zone "0.0.127.IN-ADDR.ARPA" {
	type master;
	file "named.local";
};

zone "." {
	type hint;
	file "named.ca";
};


/etc/named.ca

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  "
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC registration services
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.RS.INTERNIC.NET
;       -OR- under Gopher at    RS.INTERNIC.NET
;           under menu          InterNIC Registration Services (NSI)
;              submenu          InterNIC Registration Archives
;           file                named.root
;
;       last update:    Aug 22, 1997
;       related version of root zone:   1997082200
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; temporarily housed at NSI (InterNIC)
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     198.41.0.10
;
; housed in LINX, operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129 
;
; temporarily housed at ISI (IANA)
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; housed in Japan, operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File

/etc/named.local -- Replace "NAME" with your host's name.

@	IN	SOA	NAME.Stanford.EDU. postmaster.NAME.stanford.edu. (
			        100111103     ; Serial
                                360000        ; Refresh
                                30000         ; Retry
                                3600000       ; Expire
                                360000 )      ; Minimum
	IN	NS	NAME.Stanford.EDU.
1	IN	PTR	localhost.Stanford.EDU.

/etc/resolv.conf -- Replace "IP" with your host's IP address.

domain Stanford.EDU
nameserver IP
nameserver 171.64.7.77
nameserver 171.64.7.99
Don't replace "IP" with "127.0.0.1" or "0.0.0.0".