# Use with the following in named.conf, adjusting the allow list as needed: key "rndc-key" { algorithm hmac-md5; secret "UCfIZnTrrCZ+VD4lA23FqA=="; };
controls { inet 127.0.0.1 port 953 #inet 127.0.0.1 allow { 127.0.0.1; } keys { "rndc-key"; }; }; # End of named.conf options { directory "/usr/local/named/var"; pid-file "/usr/local/named/var/run/named/named.pid"; allow-transfer {none;}; querylog true; forwarders { 10.19.98.45; 10.19.98.20; }; }; zone "." IN { type hint; file "named.ca"; }; zone "0.0.127.in-addr.arpa" IN { type master; file "named.rev"; allow-update {none;}; }; zone "localhost" IN { type master; file "named.local"; allow-update { none; }; }; zone "baidu.com" IN{ type master; file "baidu.zone"; allow-update { none; }; }; zone "100.19.10.in-addr.arpa" IN { type master; file "baidu.rev"; allow-update { none; }; }; zone "www.126.com" IN { type master; file "126.zone"; allow-update { none; }; }; zone "98.19.10.in-addr.arpa" IN { type master; file "126.rev"; allow-update { none; }; }; b)正向解析域baidu.zone
$TTL 86400 $ORIGIN baidu.com. @ IN SOA baidu.com. root.baidu.com.( 201112300 ; 3H ; 15M ; 1W ; 1D ) ; @ IN NS baidu.com. IN A 10.19.100.164 ftp IN A 10.19.100.163 www IN A 10.19.100.162 feng IN A 10.19.100.1 mail IN CNAME feng
c)反向解析域baidu.rev
$TTL 86400 @ IN SOA baidu.com. root.baidu.com. ( 42 ; 3H ; 15M ; 1W ; 1D ); @ IN NS baidu.com. 164 IN PTR baidu.com. 162 IN PTR www.baidu.com. 163 IN PTR ftp.baidu.com. 1 IN PTR mail.baidu.com.