标签:DNS 自建 查询 allow 允许 any 配置文件
自建DNS服务
采用bind9,作为DNS服务。
安装
apt-get install -y bind9 dnsutils
配置文件
主要的配置文件在下边
options
options {
directory "/var/cache/bind";
// IPV4的监听端口和地址,127.0.0.1, localhost只能用于本机使用。
listen-on port 53 { 10.1.1.10; };
// 允许那些机器方位DNS,any为所有机器都能访问。
allow-query { any; };
// 节省资源,关闭验证
// 不做互联网认证
dnssec-validation no;
dnssec-enable no;
recursion yes;
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// 转发的上级DNS的IP
forwarders {
10.1.1.254;
};
// 设置允许进行递归查询的ip地址列表,缺省值是允许所有地址进行查询,需要注意的是当设置了不允许递归查询后,如果仍然能够查询部分外部的域名,那是因为dns的缓存在起作用,将缓存清除以后就可以了。
//allow-recursion { internals; };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
// ipv6监听
// listen-on-v6 { any; };
};
标签:DNS,自建,查询,allow,允许,any,配置文件 来源: https://www.cnblogs.com/linga/p/15116688.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。