Home‎ > ‎unix/linux‎ > ‎bind‎ > ‎

centos named

1. Installing:

Install Bind and the DNS utilities:
# yum install bind.i386
# yum install bind-utils.i386

2. Overview:

2.1 Where:

Everything is chrooted for security.  All the files will go in this directory:
# cd /var/named/chroot/var/named/

2.2 What:

In Bind, there are a couple of files to keep track of:
  1. named.conf: This lists what all the other files are named
  2. "db.ADDR":  The forward name space or the primary name file.  It won't be labeled "db.ADDR", instead the "ADDR" will be replaced with your domain name, ie: "db.cmed"
  3. "db.REVERSE": which lists the IP's and what name should be associated to them.  There will be one per class "C" network, and one for link local.
You will need to create these files, and you will place them in the following locations.

2.3 How:

Starting and stopping bind in centos is very simply, simply enter the following commands:
service named start|stop|status|restart

The log files can be found in the following directories:


3. Setting Up:

3.1 resolv.conf

You are going to have to create your own config and db files to get going, but first, lets make sure this computer knows it's a name server.

vim /etc/resolv.conf

Tell the local resolver to resolve "nameserver" to the IP address of the server you are setting up. 


3.2 named.conf:

The named.conf file is the main "table of contents" file that points to all of the other files and where they are located. 

You can view the default example file in

and if you want to start with this and modify it, you could always copy it to the correct location and edit it there. 
cp /usr/share/doc/bind-9.x.x/sample/etc/named.conf /var/named/chroot/etc/named.conf

For reference, we have two named.conf files to refer to:

db.ADDR Example

The following is an example of the db.cmed file:
vim /var/named/chroot/var/named/db.cmed

$ORIGIN cmed.us. ; designates the start of this zone file in the name space
$TTL 1h ; default expiration time of all resource records without their own TTL value
cmed.us. IN SOA ns.cmed.us. username.cmed.us. (
2010121300 ; serial number of this zone file
1d ; slave refresh (1 day)
2h ; slave retry time in case of a problem (2 hours)
4w ; slave expiration time (4 weeks)
1h ; minimum caching time in case of failed lookups (1 hour)
; Name servers
cmed.us. NS ns ; ns.cmed.us is a nameserver for cmed.us

; Mail servers
cmed.us. MX 10 mail.cmed.us. ; mail.cmed.us is the mailserver for cmed.us

; ### ---------- Public, v10 ------------ ###
demark A

www.v10 A

dhcp10.0 A
dhcp10.1 A
dhcp10.2 A
dhcp10.3 A
dhcp10.4 A
dhcp10.5 A
dhcp10.6 A
dhcp10.7 A
dhcp10.8 A
dhcp10.9 A
dhcp10.10 A
dhcp10.11 A
dhcp10.12 A
dhcp10.13 A
dhcp10.14 A
dhcp10.15 A
dhcp10.16 A
dhcp10.17 A
dhcp10.18 A
dhcp10.19 A
dhcp10.20 A
dhcp10.21 A
dhcp10.22 A
dhcp10.23 A
dhcp10.24 A
dhcp10.25 A
dhcp10.26 A
dhcp10.27 A
dhcp10.28 A
dhcp10.29 A

pix.v10 A

; ### ---------- DMZ, v11 ------------ ###
pix.v11 A

gallery A


; ### ---------- private, v12 ------------ ###
; .1-.9 = defroutes
pix.v12 A
pix cname pix.v12
defroute cname pix.v12

; .10-.19 = appliances
printer A
squeezebox A
wii A

; .30-.39 = servers
taco          A
filer         cname   taco

brie A
mail cname brie
ns cname brie

; .50-.59 = static desktops
kitchen A

; .100-.129 = dhcp pool
dhcp11.0 A
dhcp11.1 A
dhcp11.2 A
dhcp11.3 A
dhcp11.4 A
dhcp11.5 A
dhcp11.6 A
dhcp11.7 A
dhcp11.8 A
dhcp11.9 A
dhcp11.10 A
dhcp11.11 A
dhcp11.12 A
dhcp11.13 A
dhcp11.14 A
dhcp11.15 A
dhcp11.16 A
dhcp11.17 A
dhcp11.18 A
dhcp11.19 A
dhcp11.20 A
dhcp11.21 A
dhcp11.22 A
dhcp11.23 A
dhcp11.24 A
dhcp11.25 A
dhcp11.26 A
dhcp11.27 A
dhcp11.28 A
dhcp11.29 A

; .240-.249 = switches
zugzug A
switch A