Garey's Blog–FreeBSD/PHP/GoLang

十二月 15th, 2009

FreeBSD Name Server配置

9,738 views, FreeBSD, by garey.

FreeBSD系统自带BIND软件,我们编辑/etc/namedb/named.conf即可设置BIND。

把默认的named.conf作个备份
cp /etc/namedb/named.conf /etc/namedb/named.conf.default

修改named.conf
options选项增加
allow-query     { any; };
recursion       no;        // 不提供递归服务
去掉
listen-on       { 127.0.0.1; };

域名记录增加
zone “bsdartbsdart.org” {
type master;
file “bsdart/bsdart.org.db”;
};

zone “23.51.210.in-addr.arpa” {
type master;
file “bsdart/bsdart.org.rev”;
};

新建bsdart目录
mkdir /etc/namedb/bsdart
chown -R bind:wheel /etc/namedb/bsdart

cd /etc/namedb/bsdart
vi bsdart.org.db
$TTL 3600
bsdart.org.     IN      SOA     dns.bsdart.org. admin.bsdart.org. (
2009070901      ; Serial
10800           ; Refresh
3600            ; Retry
604800          ; Expire
300 )           ; Negative Reponse TTL
; DNS Servers
IN      NS      dns.bsdart.org.
; MX Records
IN      MX 10   mail.bsdart.org.

IN      A       210.51.23.23
; Machine Names
localhost       IN      A       127.0.0.1
mail            IN      A       210.51.23.23
dns             IN      A       210.51.23.23
; Aliases
www             IN      CNAME   bsdart.org.

vi bsdart.org.rev
$TTL 3600
23.51.210.in-addr.arpa. IN SOA dns.bsdart.org. admin.bsdart.org. (
2009070901      ; Serial
10800           ; Refresh
3600            ; Retry
604800          ; Expire
300 )           ; Negative Reponse TTL
IN      NS      dns.bsdart.org.
23      IN      PTR     mail.bsdart.org.

vi /etc/rc.conf
新增
named_enable=”YES”

Back Top

回复自“FreeBSD Name Server配置”

  1. 引用:FreeBSD Name Server配置 - FreeBSD技术文摘

发表评论