Bind基本配置
时间:2010-12-03 来源:superzgc
Bind基本配置
1、安装bind
下载bind-9.7.2-P2
#tar xvf bind-9.7.2.-P2
#./configure –prefix=/app/named --disable-ipv6 --disable-openssl-version-check --enable-threads
#make
#make install
2、配置bind
生成rndc.conf文件
#/app/named/sbin/rndc-confgen > /app/named/etc/rndc.conf
生成named.conf文件
#tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf
创建/var/named,并且创建几个文件
第一:localhost.zone
$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS @
1D IN A 127.0.0.1
第二:named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
第三:named.root
#/app/named/bin/dig > /var/named/named.root
第四:需要解析的域名test.zone
$ttl 1D
@ IN SOA test.com. root.test.com. (
1053891162
3H
15M
1W
1D )
IN NS dns.test.com. #注意此处为dns服务器机器名
IN MX 5 dns.test.com. #注意此处为dns服务器机器名
www IN A 192.168.0.66
第五:域名的反向解析test.local
$TTL 86400
@ IN SOA test.com. root.test.com.(
20031001;
7200;
3600;
43200;
86400);
@ IN NS test.com.
82 IN PTR www.test.com.
第六:补充named.conf内容
options {
directory "/var/named"; #named区文件目录
pid-file "named.pid"; #进程id文件名
};
zone "." IN {
type hint;
file "named.root";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "test.com" IN {
type master;
file "test.zone";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "test.local";
allow-update { none; };
};
3、运行bind
#/app/named/sbin/named -gc /app/named/etc/named.conf
参数-gc可以显示named运行情况。