1.Extract install file.
tar zxvf bind-9.7.0.tar.gz
2.Change work directory.
cd bind-9.7.0
3.Config,compile and install.
./configure --prefix=/usr/local/named --enable-threads #--enable-threads
make
su
make install
4.Create key file for rndc command.
cd /usr/local/named
sbin/rndc-confgen > etc/rndc.conf
5.Get the key from rndc.conf for named.conf.
cd /etc
tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf
6.Create Zone file directory.
mkdir /var/named
cd /var/named
7.Create Zone files.
8.Config /etc/named.conf.
options {
directory "/var/named";
};
key "rndc-key" {
algorithm hmac-md5;
secret "xmIhTyX+JTbIYVfvFiRWtg==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
logging {
channel my_file {
file "/var/named/log.msgs";
severity dynamic;
print-category yes;
print-severity yes;
print-time yes;
};
category default { my_file; };
category queries { my_file; };
};
zone "movie.edu" in {
type master;
file "db.movie.edu";
};
zone "249.249.192.in-addr.arpa" in {
type master;
file "db.192.249.249";
};
zone "253.253.192.in-addr.arpa" in {
type master;
file "db.192.253.253";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "db.127.0.0";
};
zone "." in {
type hint;
file "db.cache";
};
9.Start bind.
/usr/local/named/sbin/named -c /etc/named.conf
10.Start log trace.
rndc status
rndc trace
11.Test DNS.
host localhost
host 127.0.0.1
12.Check logs.
cat /var/named/log.msgs
阅读(542) | 评论(0) | 转发(0) |