- /etc/named.conf
The main configuration file.
// Where are the zone files kept?
options {
directory "/var/named" ;
recursion no ;
listen-on { 192.168.0.100 ; } ;
} ;
//In the above I put "recursion no" so that my DNS server woudn't
// look up addresses for clients. In this lab setting that I set
// up the server, I had no internet access so I didn't want to
// waste time looking up addresses that I can't get to anyway.
//In the above we state that the DNS server will be listening on
// address 192.168.0.100.
//I set up the following logging for testing, especially
// to get the DNS service working correctly.
// I would turn off some of the logging, so it wouldn't
// load up the Red Hat server too much.
logging {
category config { default_syslog ; } ;
category parser { default_syslog ; } ;
category load { default_syslog ; } ;
category update { default_syslog ; } ;
category xfer-in { default_syslog ; } ;
category xfer-out { default_syslog ; } ;
category security { default_syslog ; } ;
category queries { default_syslog ; } ;
} ;
// Zones for which we're master
zone "linuxclinic.org" in {
type master ;
file "linuxclinic.org" ;
allow-update { localnets ; } ;
} ;
zone "0.168.192.in-addr.arpa" in {
type master ;
file "192.168.0.0" ;
allow-update { localnets ; } ;
} ;
// Zones for which we're master
// Faked out ".com" sites I am hosting on this server for use
// in the labs - remember I have no internet access during
// the class.
zone "com" in {
type master ;
file "com" ;
} ;
// How do we contact the root servers?
zone "." in {
type hint ;
file "root.cache" ;
} ;
- /var/named/root.cache
The root.cache file is also called sometimes the "hints" file. Rather than copy this one in, find one located on your system or download a fresh one from the web. "updatedb; locate root.cache"
; 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: Nov 8, 1995
; related version of root zone: 1995110800
;
;
; 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
; End of File
- /var/named/linuxclinic.org
This file is to configure the domain I am serving.
$ORIGIN linuxclinic.org.
$TTL 5m
@ IN SOA ns1 riblack.ns1 (
2001052207 ; serial number
3h ; refresh
30m ; retry
1w ; expire
5m ) ; minimum TTL
NS ns1 ; name server
MX 10 smtp ; primary mail exchanger
MX 20 ns2 ; secondary mail exchanger
; Servers
server A 192.168.0.1
ns1 A 192.168.0.100
ns2 A 192.168.0.101
smtp A 192.168.0.102
www A 192.168.0.103
web CNAME www ; Alias #1 for "www"
w3 CNAME www ; Alias #2 for "www"
; Routers
hq-cisco1-e0 A 192.168.0.1 ; router interface
hq-cisco1 CNAME hq-cisco1-e0 ; "generic" alias
- /var/named/192.168.0.0
The following file is for reverse lookup in my domain. Note that the ip gets reversed in this file because that is how reverse lookups are done - backwards.
$ORIGIN 0.168.192.in-addr.arpa.
$TTL 5m
@ IN SOA ns1.linuxclinic.org. riblack.ns1.linuxclinic.org. (
2001052206 ; serial number
3h ; refresh
30m ; retry
1w ; expire
5m ) ; minimum TTL
NS ns1.linuxclinic.org. ; name server
1 PTR server.linuxclinic.org.
100 PTR ns1.linuxclinic.org.
101 PTR ns2.linuxclinic.org.
102 PTR smtp.linuxclinic.org.
103 PTR www.linuxclinic.org.
#The following are faked out addresses that I am hosting for the lab
# In class, the students may go to the following sites and do downloads;
# however, these sites are hosted on this same server.
90 PTR www.compaq.com.
91 PTR ftp.compaq.com.
92 PTR www.geocities.com.
- /var/named/com
This next "com" file contains all the faked out .com addresses we are hosting on our server for the class. If I needed to fake out .org addresses and .net addresses, I would have generated a "org" and a "net" file for those as well. You do not need to do this on a real DNS server, but this is good info for setting up to teach a Linux networking class.
$ORIGIN com.
$TTL 5m
@ IN SOA ns1.linuxclinic.org. riblack.ns1.linuxclinic.org. (
2001052208 ; serial number
3h ; refresh
30m ; retry
1w ; expire
5m ) ; minimum TTL
NS ns1.linuxclinic.org. ; name server
; Servers
www.compaq.com. A 192.168.0.90
ftp.compaq.com. A 192.168.0.91
www.geocities.com. A 192.168.0.92
- /etc/resolv.conf
/etc/resolv.conf points to dns servers
search linuxclinic.org
domain linuxclinic.org
nameserver 192.168.0.100
- /var/log/messages
Check /var/log/messages for error messages regarding named. Can type "tail -f /var/log/messages" in one window and start named in another.
- /etc/rc.d/init.d/named start
Command to start named
- /etc/rc.d/init.d/named reload
Command to reload named after you make changes to the zone files
- nslookup
- tool used to test nslookups
nslookup
server 127.0.0.1
ls linuxclinic.org
ls -d linuxclinic.org
ls -d 0.168.192.in-addr.arpa
- dig
- tool used to test nslookups