這是本文件的舊版!
BIND
install
pkg install bind911 sysrc named_enable=“YES”
generate key (note that the service start will do that)
rndc-confgen -a
check config
named-checkconf named-checkzone localhost /var/named/<filename>
set directory
options { // All file and path names are relative to the chroot directory, // if any, and should be fully qualified. directory "/usr/local/etc/namedb"; ... }
debug config
logging { channel default-log { file "/var/log/named.log" versions 10 size 200m; severity info; print-severity yes; print-time yes; }; category lame-servers { default-log; }; category security{ default-log;}; category queries { default-log;}; category default { default-log;}; };
# zone
zone "example.org" { type master; file "master/example.org"; };
zone file
$TTL 3600 ; 1 hour default TTL example.org. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 300 ; Negative Response TTL ) ; DNS Servers IN NS ns1.example.org. IN NS ns2.example.org. ; MX Records IN MX 10 mx.example.org. IN MX 20 mail.example.org. IN A 192.168.1.1 ; Machine Names localhost IN A 127.0.0.1 ns1 IN A 192.168.1.2 ns2 IN A 192.168.1.3 mx IN A 192.168.1.4 mail IN A 192.168.1.5 ; Aliases www IN CNAME example.org.