install bind from yum

Jump to: navigation, search

Install bind

yum -y install bind bind-devel bind-libs bind-utils

Copy configuration files to etc

cp /usr/share/doc/bind-9.3.6/sample/etc/* /etc
rsync -vrplogDtH /usr/share/doc/bind-9.3.6/sample/var/named/ /var/named/
chown -R named:named /var/named/

Set key



On Newer systems, run

[[email protected] ~]# /usr/sbin/ddns-confgen
# To activate this key, place the following in named.conf, and
# in a separate keyfile on the system or systems from which nsupdate
# will be run:
key "ddns-key" {
        algorithm hmac-sha256;
        secret "mRTlFXIr0ChnvR4c4Il5ngHkcPlrksLtm54STgkCovw=";

# Then, in the "zone" statement for each zone you wish to dynamically
# update, place an "update-policy" statement granting update permission
# to this key.  For example, the following statement grants this key
# permission to update any name within the zone:
update-policy {
        grant ddns-key zonesub ANY;

# After the keyfile has been placed, the following command will
# execute nsupdate using this key:
nsupdate -k <keyfile>
[[email protected] ~]#

You will get key

[[email protected] ~]# /usr/sbin/dns-keygen
[[email protected] ~]#

Edit /etc/named.conf

vi /etc/named.conf


key ddns_key
	algorithm hmac-md5;
	secret "use /usr/sbin/dns-keygen to generate TSIG keys";

Replace with

key ddns_key
	algorithm hmac-md5;
	secret "rqv9DdgZ0lMjzFdCG03W9ZDnch2oX2R4uUIc3hIoufaCsT4sU4fho7qVtzFW";

Set Bind start on Boot

chkconfig named on

Verify it with

chkconfig --list|grep named

Debug Bind

Test start and view bind messages

service named stop
echo > /var/log/messages
service named start
cat /var/log/messages

Start Bind

service named start

To stop

service named stop

Add DNS Zone

To host DNS for domain edit /etc/named.conf

vi /etc/named.conf

Add in external view

	zone "" { 
		type master;
		file "";

Create a file /var/named/

vi /var/named/

Add Following content to the file

$TTL 14400	86400	IN	SOA	(
						2008091002 ;Serial Number
						86400 ;refresh
						7200 ;retry
						3600000 ;expire
						86400 ;minimum
	)	86400	IN	NS	86400	IN	NS	14400	IN	A
localhost	14400	IN	A	14400	IN	MX	0
mail	14400	IN	CNAME
www	14400	IN	CNAME
ftp	14400	IN	A
ns1	14400	IN	A
ns2	14400	IN	A
server1	14400	IN	A

Now restart bind

service named restart

On a remote server, you will be able to run

nslookup ip-of-dns-server