自建DNS

自建DNS服务

采用bind9,作为DNS服务。

Debian官方WIKI

安装

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; };
};
posted @   咕咚!  阅读(363)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2018-08-08 html
2018-08-08 CentOS 7编译安装Python3.7.X
点击右上角即可分享
微信分享提示