debian13.7 dns bind9 named 設定

Brave Ye
系統管理員
Posts: 6294
Joined: 2025-11-08, 05:32
Location: Taiwan

debian13.7 dns bind9 named 設定

Post by Brave Ye »

nano /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.root-hints"; include "/etc/bind/named.conf.internal-zones";
nano /etc/bind/named.conf.options
// add : set ACL entry for local network acl internal-network { 123.241.40.195; }; options { directory "/var/cache/bind"; // add like follows // add local network set on [acl] section above // network range you allow to recieve queries from hosts allow-query { localhost; internal-network; }; // network range you allow to transfer zone files to clients // add secondary DNS servers if it exist allow-transfer { localhost; }; // allow recursion recursion yes; dnssec-validation auto; listen-on port 53 { any; }; // if not listen IPV6, change [any] to [none] listen-on-v6 { none; }; };
nano /etc/bind/named.conf.internal-zones
// create new // add zones for your network and domain name zone "zine-tw.com" IN { type primary; file "/etc/bind/zine-tw.com.lan"; allow-update { none; }; }; zone "40.241.123.in-addr.arpa" IN { type primary; file "/etc/bind/40.241.123.db"; allow-update { none; }; };
nano /etc/default/named
# # run resolvconf? RESOLVCONF=no # startup options for the server OPTIONS="-u bind -4"
nano /etc/bind/zine-tw.com.lan
$TTL 86400 @ IN SOA ns1.zine-tw.com. root.zine-tw.com. ( ;; any numerical values are OK for serial number ;; recommended : [YYYYMMDDnn] (update date + number) 2026100401 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) ;; define Name Server IN NS ns1.zine-tw.com. ;; define IP address of the domain IN A 123.241.40.195 ;; define Mail Exchanger Server IN MX 10 mail.zine-tw.com. ;; define each IP address of a hostname @ IN A 123.241.40.195 www IN A 123.241.40.195 ns1 IN A 123.241.40.195 mail IN A 123.241.40.195
nano /etc/bind/40.241.123.db
$TTL 86400 @ IN SOA www.zine-tw.com. root.zine-tw.com. ( 2026100401 ;Serial 3600 ;Refresh 1800 ;Retry 604800 ;Expire 86400 ;Minimum TTL ) ;; define Name Server IN NS ns1.zine-tw.com. ;; define each hostname of an IP address 195 IN PTR zine-tw.com. 195 IN PTR www.zine-tw.com. 195 IN PTR ns1.zine-tw.com. 195 IN PTR mail.zine-tw.com.
nano /etc/resolv.conf
# Generated by NetworkManager search tbcnet.net.tw nameserver 139.175.1.243 nameserver 8.8.8.8 nameserver 123.241.40.195