For a caching only name server the configuration below is all that is entered into the named.conf file located in the /etc directory. The root.hint and 127.0.0.zone files are listed below it. You should also edit the /etc/nsswitch.conf as indicated at the bottom of the page.
// Filename: /etc/named.conf
// Configuration file for a caching only name server
options {
directory "/var/named";
};
zone "." IN {
type hint;
file "root.hint";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0.zone";
};
// /var/named/root.hint
;
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 . <file>"
; 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
// Filename: 127.0.0.zone
$ORIGIN
0.0.127.in-addr.arpa.
@
1D IN
SOA localhost.
root.localhost. (
42
; serial
3H
; refresh
15M
; retry
1W
; expire
1D )
; minimum
1D IN NS
localhost.
1
1D IN
PTR localhost.
// End of File
In the /etc/nsswitch.conf file add a line that says:
hosts: files dns
This says to search the /etc/hosts file and then the DNS server referenced in the /etc/resolv.conf file when trying to resolve names.