1.转发DNS,缓存DNS,这两种类型功能很相近,转发DNS有缓存,缓存DNS有转发,在named.conf文件中配置
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory"/var/named";
dump-file"/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
// Those options should be used carefully because they disable port
// randomization
// query-sourceport 53;
// query-source-v6 port 53;
forwarders { 192.168.8.201; };//向上级DNS查询的地址
forward only;//仅转发,如果对方没有就不再查询
//forward first;//先转发查询,如果查询不到就向根查询
allow-query{ any; };//允许查询的ACL
allow-query-cache { any; };//允许查询缓存的ACL
};