controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; zone "." IN { type hint; file "named.ca"; };
zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; }; };
zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; };
以上是系统默认的本地配置,不需要修改。以下为你适合本机的配置,我已经写出来了。 zone "0.168.192.in-addr.arpa" IN { type master; // 角色为主域名服务器 file "named.dns.com"; //存放反向解析的配置文件名 allow-update {none;}; };
zone "dns.com" IN { type master; // 如上 file "dns.com.zone"; // 如上,注意文件名的变化和后面的符号 allow-update { none; }; };
#include "/etc/rndc.key"; ===================================== 下面我们去 /var/named目录下完成对 named.dns.com and dns.com.zone的配置 The content of named.dns.com $TTL 86400 // refresh time always is one day @ IN SOA localhost. root.dns.com. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS === defalut is 3 IN PTR mail.dns.com. === add mail.dns.conm 3 IN PTR ===以下类同.....看清楚符号 3 IN PTR ftp.dns.com.
$TTL 86400 $ORIGIN dns.com. @ 1D IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum
1D IN NS @
www 1D IN A 192.168.0.3 mail 1D IN A 192.168.0.3 ftp 1D IN A 192.168.0.3 @ 1D IN A 192.168.0.3 === add default