※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

編集 Top > bind9
bind9 9.4.2
# cd /usr/ports/dns/bind9 
# make install clean
# vi /etc/namedb/named.conf
listen-on { 127.0.0.1;
      192.168.0.0/24;};

zone "." { type hint; file "named.root"; };

zone "local.zone" {
    type master;
    file "master/local.zone";
};
zone "0.0.127.in-addr.arpa" {
    type master;
    file "master/local.rev";
};
zone "ex.local" {
    type master;
    file "dynamic/ex.local.zone";
    allow-update {
    127.0.0.1};
};
zone "0.168.192.in-addr.arpa" {
    type master;
    file "dynamic/ex.local.rev";
    allow-update {
    127.0.0.1};
};
# vi /etc/namedb/master/local.zone
$TTL 86400
@ IN SOA localhost. root.localhost. (
        2008111101
        3600
        900
        604800
        86400)
    IN NS localhost.
    IN A 127.0.0.1
# vi /etc/namedb/master/local.rev
$TTL 86400
@ IN SOA localhost. root.localhost. (
        2008111101
        3600
        900
        604800
        86400)
    IN NS localhost.
1 IN PTR localhost.
# vi /etc/namedb/master/ex.local.zone
$TTL 86400
@ IN SOA server.ex.local. root.server.ex.local. (
        2008111101
        3600
        900
        604800
        86400)
    IN NS server.ex.local.
router IN A 192.168.0.1
server IN A 192.168.0.2
dns IN CNAME server.ex.local.
# vi /etc/namedb/master/ex.local.rev
$TTL 86400
@ IN SOA server.ex.local. root.server.ex.local. (
        2008111101
        3600
        900
        604800
        86400)
    IN NS server.ex.local.
1 IN PTR router.ex.local.
2 IN PTR server.ex.local.
# vi ddns
server 192.168.0.1
update add cl1.os.local 300 IN A 192.168.0.2
update add cl2.os.local 300 IN A 192.168.0.3
update add cl3.os.local 300 IN A 192.168.0.4
update add cl4.os.local 300 IN A 192.168.0.5

最後は必ず一行空ける
# vi /etc/rc.conf 自動起動
named_enable="YES"
# named
# nsupdate -vd ddns