我安装的是solaris 10,一路安装非常顺利,安装过程就不必讲了,按照提示next就ok,一共安装了五张盘!
1、10自带的bind版本是:named -v 9.2.4
2、需要自己配置好以下五个文件(有的文件名可根据个人的习惯):
named.conf 这个文件,放在/etc,可根据不同习惯放在相应的文件夹下,下面放在/var/named下
named.root 根区域文件,可从标准配置中copy过来,如果是建自己的内部的dns,可完全修改。我就是军网的根域dns,所以自己改了此文件
localhost.zone named.local 这二个文件是配置localhost的,就不用多说了!标准配置
mtn.local, mtn.zone 这二个是根据自己在named.conf定义的zone来配置的!
下面是详细的配置:
named.conf
options {
directory "/var/named";
};
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 "mtn" IN {
type master;
file "mtn.zone";
allow-update { none; };
}; 自己需要定义的zone
zone "2.18.21.in-addr.arpa" IN {
type master;
file "mtn.local";
allow-update { none; };
};
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.boot
. 3600000 NS mtn.
mtn. 3600000 A 21.18.2.202
;
. 3600000 NS kdwdns1.
kdwdns1. 3600000 A 21.10.1.1 ;自己内部的另一根ns
mtn.zone
$TTL 86400
@ IN SOA mtndns1.mtn. root.mtndns1.mtn.(
20031001;
7200;
3600;
43200;
86400);
@ IN NS mtndns1.mtn.
202 IN PTR mtndns1.mtn.
mtn.local
$TTL 1D
$ORIGIN mtn.
@ IN SOA mtndns1.mtn. root.mtndns1.mtn. (
1053891162
3H
15M
1W
1D );
@ IN NS mtndns1.mtn.
hqzh IN NS dns.hqzh;二级域名
gfkd IN NS dns.gfkd ;二级域名
mtndns1 IN A 21.18.2.202
www IN A 21.18.2.230
dns.hqzh IN A 21.156.160.2
dns.gfkd IN A 27.132.1.253
3、配置文件制作好后,放在相应的文件夹下,可以启动named服务了
/usr/sbin/named -g
可以看到如下信息:
Sep 05 08:38:25.867 starting BIND 9.2.4 -g
Sep 05 08:38:25.868 using 2 CPUs
Sep 05 08:38:25.889 loading configuration from '/etc/named.conf'
Sep 05 08:38:25.894 listening on IPv4 interface lo0, 127.0.0.1#53
Sep 05 08:38:25.897 listening on IPv4 interface hme0, 21.18.2.202#53
Sep 05 08:38:25.910 command channel listening on 127.0.0.1#953
Sep 05 08:38:25.911 couldn't add command channel ::1#953: address not available
Sep 05 08:38:25.912 ignoring config file logging statement due to -g option
Sep 05 08:38:25.919 zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Sep 05 08:38:25.921 zone 2.18.21.in-addr.arpa/IN: loaded serial 20031001
Sep 05 08:38:25.923 zone localhost/IN: loaded serial 42
Sep 05 08:38:25.926 zone mtn/IN: loaded serial 1053891162
Sep 05 08:38:25.926 running
看到runing,就说明named已成功启用
4、用nslookup 或dig命令测试
如dig @21.18.2.202 gfkd.mtn ns
5、测试配置文件没有错误后,启动服务/usr/sbin/named -c /etc/named.conf就能用ps -ef |more named看到相应的服务已启动。
这是我对solaris 10下的bind的一点实践!有几点问题望跟贴指点:
1、如果想升级到9.3.2版本的话,如何停止自带的9.2.4?
2、用9.3.2版本编译时,./configure时报以下错误:
“AR program not found ,please fix you path to include the directory in which ar resides or set ar in the enviroment with the full path to ar”
按照兄弟的指点,需要改.profile里的path,不知道如何修改,并且10下找不到相应的profile?这个问题如何解决?
3、在第四步的时候,
Sep 05 08:38:25.910 command channel listening on 127.0.0.1#953
Sep 05 08:38:25.911 couldn't add command channel ::1#953: address not available
Sep 05 08:38:25.912 ignoring config file logging statement due to -g option
这个错误,如何校正?我自己感觉应该是本服务器的dns客户端配置问题?但不知道如何修改?没有resolv.conf等文件?
4、如何成为自启动服务?并且rndc没有搞定?如何通过rndc来控制bind运行?
欢迎大家跟贴批评指正!
阅读(2509) | 评论(0) | 转发(0) |