[原创教程]在FreeBSD下安装BIND,提供dns服务
一.用ports方式安装bind9
#/usr/ports/dns/bind9 #make install clean
并在/etc/rc.conf文件里添加一行:
named_enable=”YES”
作为系统服务启动.
二.配置BIND
1.编辑/etc/namedb/named.conf 文件,在最下面以下两部分
#正向解析配置文件
zone “haohtml.com” { type master; file “master/haohtml.com”; };
#反向解析配置文件
zone “0.168.192.in-addr.arpa” { type master; file “master/0.168.192.in-addr.arpa”; };
然后编辑 listen-on {127.0.0.1;}; 的后面添加监听ip地址,如下:
listen-on {127.0.0.1; 192.168.0.222;};
第个ip后面加一个”;”符号.
对于转发一部分,我们暂不进行配置,这里用不到的.
============================ 2.新建 master/haohtml.com 文件,把下面的内容添加进去
$TTL 172800 @ IN SOA haohtml.com. root.haohtml.com. ( 2010090617; Serial 172800; Refresh 900; Retry 3600000; Expire 3600); Minimum IN NS haohtml.com. IN A 192.168.0.222 www IN A 192.168.0.222 bbs IN A 192.168.0.222 ceshi IN A 192.168.0.222
By admin
read more